How to Fix WordPress 404 Errors (Posts and Pages Not Found)

How to Fix WordPress 404 Errors (Posts and Pages Not Found)

WordPress 404 errors — “Page Not Found” — occur when a visitor requests a URL that your site cannot match to any existing page or post. The most common cause is a permalink structure change that broke existing URLs, a corrupted .htaccess file, or a deleted page that was not redirected. In most cases, the fix is as simple as resaving your permalink settings, which takes about 30 seconds.

404 errors are particularly damaging when they affect pages that Google has already indexed or that other sites link to. Every 404 is a lost visitor, a lost potential customer, and wasted crawl budget that Google could spend indexing your actual content. If you have widespread 404 errors, fixing them should be an immediate priority.

What Causes 404 Errors in WordPress?

Permalink structure change. If you changed your WordPress permalink settings (Settings → Permalinks) — for example, switching from plain (?p=123) to post name (/my-post-title/) — all your old URLs instantly become invalid. This is the most common cause of sudden, site-wide 404 errors.

Corrupted .htaccess file. WordPress uses .htaccess to translate pretty permalinks into the underlying URL structure. If this file is missing, empty, or corrupted, WordPress cannot route requests to the correct content, and everything except the homepage may return a 404.

Deleted or unpublished content. A page or post was deleted, moved to trash, or changed from “Published” to “Draft” — but other pages, search engines, or external sites still link to the old URL.

Plugin or theme conflict. Some plugins modify WordPress’s URL routing or register custom post types and taxonomies. If such a plugin is deactivated or removed, URLs it created may stop resolving.

Server migration. After migrating to a new host, .htaccess rules or server configuration (Apache vs Nginx) may not be correctly set up for WordPress permalink routing.

Custom post type slug conflict. If a custom post type or taxonomy uses the same slug as an existing page, WordPress may not resolve the URL correctly, resulting in 404 errors for one or both.

Step 1: Resave Your Permalink Settings

This is the fix for the majority of WordPress 404 errors, and it takes seconds. Go to Settings → Permalinks in your WordPress admin. Do not change anything. Simply click “Save Changes.”

This forces WordPress to regenerate the rewrite rules in your .htaccess file (on Apache servers) or to flush its internal rewrite rules (on Nginx servers with WordPress-managed rules). After saving, test the URLs that were returning 404 errors. In many cases, this single action resolves the problem completely.

If you cannot access your WordPress admin because the admin itself is returning errors, skip to Step 2.

Step 2: Check and Reset the .htaccess File

If resaving permalinks did not work, the .htaccess file itself may be missing or corrupted. Via FTP or your hosting file manager, navigate to your WordPress root directory and look for the .htaccess file (it is a hidden file — enable “Show hidden files” in your client).

If .htaccess is missing: Create a new file named .htaccess in your WordPress root directory with the following default WordPress content:

# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

If .htaccess exists but might be corrupted: Rename it to .htaccess-backup and create a new one with the content above. Then go to Settings → Permalinks in your admin and click “Save Changes” to let WordPress regenerate the file with the correct rules for your permalink structure.

Step 3: Check for Nginx Configuration Issues

If your server runs Nginx instead of Apache, there is no .htaccess file — Nginx uses its own configuration files. WordPress pretty permalinks on Nginx require a specific rewrite rule in your server block:

location / {
  try_files $uri $uri/ /index.php?$args;
}

If this rule is missing from your Nginx configuration, all WordPress URLs except the homepage will return 404 errors. You typically cannot edit Nginx configuration on shared hosting — contact your hosting provider to verify this rule is in place. On a VPS or dedicated server, add it to your site’s server block in the Nginx configuration.

Step 4: Check for Plugin Conflicts

If the 404 errors started after installing, updating, or deactivating a plugin, that plugin may be the cause. Plugins that register custom post types, create custom URL structures, or modify WordPress’s rewrite rules can cause 404 errors when deactivated — because the URLs they created are no longer being handled.

If you recently deactivated a plugin and its URLs are now 404, you have two options: reactivate the plugin (which will restore its URL handling) or set up 301 redirects from the old URLs to relevant existing pages.

If the 404 errors started after a plugin update, temporarily deactivate the updated plugin to confirm it is the cause. If it is, check for a newer version or contact the developer. See our plugin conflict troubleshooting guide for the full diagnostic process.

Step 5: Fix Individual 404 Errors with Redirects

If specific pages were deleted, moved, or had their slugs changed, the old URLs will return 404 errors. The correct fix is a 301 redirect — a permanent redirect that tells browsers and search engines “this content has permanently moved to a new URL.”

You can set up redirects using Rank Math’s Redirection module (if you use Rank Math for SEO), the Redirection plugin (a free, dedicated redirect management plugin), or manually in your .htaccess file (for Apache servers).

To find which URLs are returning 404 errors, check Google Search Console under Coverage → “Not found (404)” or Pages → “Not found (404).” This shows you every URL that Googlebot tried to crawl and received a 404 response. Prioritise redirecting URLs that had significant traffic or backlinks from other sites.

For a comprehensive guide to redirect types and implementation, read our article on setting up WordPress redirections properly.

Step 6: Check for Slug Conflicts

WordPress can generate 404 errors when two items share the same slug — for example, a page and a category with the same URL slug, or a page and a custom post type archive. WordPress may not know which one to serve, resulting in a 404 for one or both.

Check your pages, categories, tags, and custom post types for duplicate slugs. If you find a conflict, rename one of the items to use a different slug and set up a redirect from the old URL if needed.

Step 7: Check for Post or Page Status Issues

If only specific posts or pages return 404 errors while the rest of your site works, those items may have been accidentally set to “Draft,” “Private,” or “Pending Review” status. Go to Posts → All Posts (or Pages → All Pages) in your admin and search for the affected content. Check its status. If it was accidentally unpublished, set it back to “Published.”

Also check the Trash. WordPress moves deleted posts and pages to the Trash, where they remain for 30 days. If the content is in the Trash, you can restore it.

How to Prevent 404 Errors

Never change permalink structure without redirects. If you change your permalink settings, set up 301 redirects from every old URL pattern to the new one. This preserves your search rankings and prevents broken links.

Set up a custom 404 page. Even with the best prevention, some 404 errors are inevitable — external sites link to typos, visitors mistype URLs, or old content gets removed. A custom 404 page with a search box, links to popular content, and a friendly message turns a dead end into a navigation opportunity.

Monitor Google Search Console regularly. Check for crawl errors monthly and redirect any 404 URLs that receive significant traffic or have external backlinks.

Use a maintenance service. Our maintenance team monitors your site 24/7 and catches 404 errors before they damage your search rankings. We also handle redirects as part of our care plans.

Frequently Asked Questions

All my posts return 404 but the homepage works. What happened?

This is almost always a .htaccess or permalink issue. Go to Settings → Permalinks and click “Save Changes.” If that does not fix it, check if your .htaccess file exists and contains the WordPress rewrite rules (see Step 2). If your server uses Nginx, verify the try_files directive is configured (Step 3).

My 404 errors started after a migration. How do I fix this?

After migrating to a new host, your .htaccess file may not have transferred correctly, the new server may use Nginx instead of Apache, or the WordPress directory path may be different. Resave permalinks first. If that does not work, verify .htaccess exists and check your server type with your new hosting provider. Our migration service handles all of this automatically.

Will 404 errors hurt my SEO?

Yes. 404 errors on URLs that Google has indexed waste crawl budget and cause those pages to drop from the search index. 404 errors on URLs with external backlinks waste the link equity those backlinks provided. Setting up 301 redirects from 404 URLs to relevant existing pages preserves both crawl budget and link equity.

How do I find all the 404 errors on my site?

Google Search Console → Pages → “Not found (404)” is the most authoritative source. It shows every URL that Googlebot attempted to crawl and received a 404 response. For real-time detection, install a redirect plugin like Redirection, which logs 404 errors as they occur on your site.

Need Expert Help? Let WP Ministry Handle It

Widespread 404 errors after a migration, a permalink change, or a plugin conflict can be complex to untangle — especially when hundreds of URLs need redirects and the root cause is not immediately obvious. Our 24/7 team resolves these issues routinely.

Call (901) 249-0909 for immediate assistance, or choose a care plan for ongoing monitoring that catches and resolves 404 errors before they damage your search rankings.

View our care plans →

Related Articles

How to Fix WordPress Permalink Issues (404 After Changing Permalinks)

How to Set Up WordPress Redirections Properly (301, 302, 307)

How to Fix WordPress 500 Internal Server Error (2026 Guide)

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment