Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Troubleshooting · Explainer

What Causes 404 Errors on Posts and Pages in WordPress

Short answer

A 404 on a post or page that exists usually means WordPress cannot match the address to the content. The most common cause is stale rewrite rules, which a permalink re-save rebuilds. Other causes are a changed slug, a trashed post, a plugin conflict, or a server that is not passing addresses to WordPress.

Key takeaways

  • A 404 on an existing post means the address has no matching rewrite rule, not that the post is deleted.
  • Re-saving permalinks rebuilds the rewrite rules, and visiting the Permalinks screen alone triggers a flush.
  • The home page keeps working when rewrite rules break, because it is index.php itself.
  • WordPress keeps trashed posts for 30 days before deleting them for good.
  • Google does not index URLs that return a 404, and it drops indexed URLs that start returning one.

What does a 404 on a post or page mean?

A 404 on a post or page means the server received the address but could not match it to any content.

MDN's 404 reference says the code only means the server cannot find the requested resource. It does not say whether the absence is temporary or permanent. A 404 on a post that still exists in your dashboard is almost never a deleted post.

The address is a pattern, not a file. No file exists at /sample-post/, so the server must hand the address to WordPress, which looks it up in its rewrite rules. When that hand-off breaks, the post 404s even though it is safe in the database.

Why does the home page work when posts 404?

The home page keeps working because it is index.php itself, so it never needs a rewrite rule to load.

Every other post and page address is a pattern that the server must pass to WordPress. If the rewrite rules are stale or the server is not reading them, the home page loads while every post returns a 404.

This split is the clearest sign that the problem is with rewrite rules, not with your content.

The same split appears after a site move, a host change, or a permalink change. If the home page works and all posts 404, start with the permalink checks in the next section.

If only one post 404s, the cause is more likely a slug, a trash, or a conflict problem.

Why do stale rewrite rules cause most post 404s?

Stale rewrite rules cause most post 404s, because WordPress matches every post address against the rules stored in its database.

A move to a new host, a restore from backup, or a plugin change can leave those rules out of date. The post still exists, but no rule matches its address, so WordPress answers with a 404.

WordPress.org's permalinks documentation notes that visiting the Permalinks screen triggers a flush of the rewrite rules.

  1. Go to Settings > Permalinks in your WordPress dashboard.
  2. Leave the structure exactly as it is and click Save Changes.
  3. Reload the post that showed the 404.

WordPress shows a confirmation that the permalink structure was updated. If it instead says you should update your .htaccess now, the file is not writable, and you must copy the rules it shows into .htaccess by hand. WordPress.org explains both messages on the Permalinks screen.

If saving permalinks does not fix it, the server may not be reading the rules at all. WordPress.org's common errors guide says that 404s with pretty permalinks can mean mod_rewrite is not enabled in Apache.

The fix is to ask your host to turn the module on. Our guide to fixing broken permalinks covers the same steps in more depth.

How can a changed slug cause a 404?

A changed slug causes a 404 when the old address has no redirect pointing to the new one.

The slug is the last part of a post or page address, such as about-us in example.com/about-us/. If someone edits the slug, the old address stops matching anything. WordPress's redirect function looks up old slugs and sends visitors to the current address with a 301 redirect.

That redirect only works for posts and other non-hierarchical types. The same function skips hierarchical post types, so a changed page slug does not redirect on its own. WordPress's function reference states that it does not attempt a redirect for hierarchical post types, which includes pages.

Check the slug under Quick Edit on the Posts or Pages screen, and change it back if the old address matters. For a page with a changed slug, add a manual redirect from the old address to the new one.

Our guide to fixing too many redirects explains how redirect rules can go wrong.

What if the post is in the trash?

A post in the trash shows a 404 to visitors, because trashed content is not published.

WordPress's trash reference says posts held in the trash for the number of days in EMPTY_TRASH_DAYS are permanently deleted, and the default value is 30 days. Until then, you can restore the post from the Trash screen and the address works again.

Open Posts, click Trash, and look for the missing post. Click Restore under its title, then reload the address. If the post is not in the trash, it was deleted for good, and your only options are a backup or a redirect to a similar page.

How do you tell a plugin or theme conflict from a server problem?

A plugin or theme conflict causes a 404 when it registers a bad rewrite rule or changes how addresses are handled.

If the 404 started right after you installed or updated a plugin, that plugin is the first suspect. WordPress.org's common errors guide recommends deactivating all plugins and reactivating them one by one. If the post loads with all plugins off, reactivate them one at a time until the 404 returns.

A theme can cause the same problem, especially after a theme switch. Switch to a default WordPress theme, such as Twenty Twenty-One, and reload the post. If it loads, the old theme is the cause, and its author or a developer needs to fix the rewrite handling.

If the 404 stays with all plugins off and a default theme active, the problem is on the server. Check the .htaccess file on Apache, or ask your host to check the server configuration on Nginx.

What if only one post type 404s?

A single post type 404ing usually means its rewrite rules were never registered, or a page shares its name.

WordPress.org's common errors guide says to check that no custom post type and single page share a name, and to re-save permalinks to flush the rules. A product, event, or portfolio type added by a plugin needs its rules registered before its addresses work.

Try re-saving permalinks first, then deactivate the plugin that adds the post type and reactivate it. If the addresses work after reactivation, the plugin had not registered its rules. If they still 404, the plugin or theme code that registers the type needs a fix.

What 404sMost likely causeFirst check
Every post, home page worksStale rewrite rulesRe-save permalinks
One post onlyChanged slug or trashed postCheck the slug and the trash
One post type onlyUnregistered rules or name clashRe-save permalinks, check for a same-named page
Posts and pages after a moveServer not reading the rulesCheck .htaccess or ask the host
Old address after a slug changeMissing redirectAdd a manual redirect for pages

What does a 404 do to your search rankings?

A 404 can remove a page from search results, because Google does not index URLs that return a 404.

Google's crawler documentation says Google does not index URLs that return a 4xx status, and it removes already indexed URLs that return one. A 404 on a popular post costs its traffic until the address works again. A site-wide 404 after a move can cost far more.

A 404 is the right answer when a page is really gone, and Google treats it as a signal to drop the URL. The problem is only when the content still exists.

Fix the cause, then ask Google Search Console to re-check the address so it can return to the index.

What mistakes should you avoid?

The biggest mistake is deleting and recreating the post, which gives it a new address and loses the old one for good.

  • Do not change the permalink structure to fix a 404, since that changes every post address on the site.
  • Do not edit .htaccess by hand before trying a permalink re-save, since a typo there can break the whole site.
  • Do not add a redirect for a post slug change, since WordPress already redirects old post slugs on its own.
  • Do not ignore a 404 on an indexed page, since Google drops it from search results over time.

Work through the causes in order: rewrite rules, slug, trash, plugin, then server. Our guide to fixing 404 errors on posts walks through the repair steps in the same order.

Frequently asked questions

Why do all my posts 404 but my home page works?

The rewrite rules that turn post addresses into pages are stale or unread. The home page is index.php itself, so it loads without them. Re-save your permalinks first, then ask your host to check the server rules if the posts still 404.

I changed a post slug and the old link still works. Why?

WordPress keeps a record of old post slugs and redirects visitors to the current address with a 301 redirect. This only works for posts and other non-hierarchical types. A changed page slug does not redirect on its own, so you need to add a manual redirect for pages.

How do I know if a 404 is caused by a plugin?

Deactivate all plugins and reload the post. If it loads, reactivate the plugins one at a time until the 404 returns, and the last one you turned on is the cause. If the post still 404s with every plugin off, the problem is in the theme or the server.

My post is in the trash. Can I get the address back?

Yes, if it has been there for less than 30 days. Open Posts, click Trash, and choose Restore under the post title. The address works again as soon as the post is published. After 30 days WordPress deletes trashed posts for good, so check the trash before that window closes.

Should I change my permalink structure to fix post 404s?

No. Changing the structure gives every post a new address, which breaks links and search results across the site. Re-save the existing structure instead, since that rebuilds the rewrite rules without changing any address. Only change the structure when you have a clear reason and a redirect plan.

Sources

  1. 404 Not Found MDN Web Docs
  2. Settings Permalinks screen WordPress.org
  3. Common WordPress errors WordPress.org
  4. wp_old_slug_redirect() WordPress Developer Resources
  5. wp_scheduled_delete() WordPress Developer Resources
  6. How HTTP Status Codes Affect Google's Crawlers Google Search Central

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test