A WordPress 404 error can be frustrating, especially when a page exists but visitors cannot access it.
You might be able to open your homepage while individual blog posts return a “404 Not Found” message.
Fortunately, many WordPress 404 problems are caused by permalink settings, rewrite rules, or incorrect URLs.
This guide explains how to diagnose and fix common WordPress 404 errors.
What Does a WordPress 404 Error Mean?
An HTTP 404 status code means that the server cannot find a resource at the requested URL.
In WordPress, this can happen when:
- A post or page has been deleted.
- The URL has changed.
- Permalink rewrite rules are incorrect.
- Apache or Nginx is misconfigured.
- A plugin changes URL routing.
- A migration leaves outdated internal links.
A 404 response is normal for a page that genuinely does not exist. The goal is to fix unexpected errors, not eliminate every 404 response.
Solution 1: Refresh WordPress Permalinks
This is one of the easiest fixes for unexpected 404 errors.
- Log in to your WordPress dashboard.
- Go to Settings → Permalinks.
- Review your permalink structure.
- Click Save Changes.
- Try opening the affected page again.
Saving permalink settings can refresh WordPress rewrite rules.
If you use Apache, WordPress may also update the .htaccess file when the file is writable.
If the error remains, continue with the next solution.
Solution 2: Check Your .htaccess File
Apache servers commonly use .htaccess to handle WordPress permalink rewriting.
A typical WordPress installation in the domain root uses rules similar to these:
# BEGIN WordPress
<IfModule mod_rewrite.c>
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]
</IfModule>
# END WordPress
Before modifying the file, create a backup.
Check that Apache allows the necessary overrides and that mod_rewrite is enabled.
If WordPress is installed in a subdirectory or uses a custom configuration, its rewrite rules may differ.
Important: These Apache rules do not apply to Nginx.
Solution 3: Check Nginx Rewrite Rules
Nginx does not use .htaccess files.
For a standard WordPress installation, the server configuration commonly includes:
location / {
try_files $uri $uri/ /index.php?$args;
}
This directive allows Nginx to serve existing files and directories while forwarding other requests to WordPress.
Add it only within the appropriate server configuration. Existing location blocks and application requirements may need additional adjustments.
After editing your configuration, test it:
sudo nginx -t
If the configuration is valid, reload Nginx:
sudo systemctl reload nginx
Avoid reloading Nginx when the configuration test fails.
Solution 4: Check Whether the Page Exists
Sometimes the problem is simply an incorrect URL.
Open the WordPress dashboard and navigate to Posts or Pages.
Check whether:
- The content is published.
- The post slug matches the requested URL.
- The page was moved to the trash.
- A parent page slug has changed.
- The content is private or otherwise restricted.
If you recently changed a URL, consider creating a permanent redirect from the old address to the new one.
For example:
/old-wordpress-guide/ → /new-wordpress-guide/
A 301 redirect is generally appropriate when a page has permanently moved.
Solution 5: Disable Plugins Temporarily
Some plugins modify WordPress routing or redirect behavior.
Possible sources of conflicts include:
- Redirect management plugins
- Security plugins
- Multilingual plugins
- Custom post type plugins
- Caching plugins
Temporarily disable recently installed or updated plugins, then test the affected URL.
If the problem disappears, reactivate plugins one at a time to identify the conflict.
On a production website, perform this test during a maintenance window or in a staging environment.
Solution 6: Clear Your Cache
Caching can cause outdated responses to remain visible after a configuration change.
Clear relevant caches, including:
- WordPress caching plugin cache
- Server-side page cache
- CDN cache, such as Cloudflare
- Browser cache
After clearing the cache, test the page in a private browsing window.
How Do 404 Errors Affect SEO?
Google does not treat every 404 response as a website problem.
If a page was intentionally removed and has no replacement, returning 404 or 410 can be appropriate.
However, unexpected 404 errors can prevent visitors and search engines from accessing important content.
Use Google Search Console to identify URLs that Google cannot index because they return a 404 response.
For each affected URL, determine whether you should restore the page, correct an internal link, redirect to a relevant replacement, or leave the 404 response in place.
Avoid redirecting every missing URL to your homepage.
Frequently Asked Questions
Why does my WordPress homepage work but posts show 404 errors?
This often indicates a permalink or server rewrite configuration problem.
Does saving permalinks fix every 404 error?
No. It may resolve rewrite-related problems, but deleted content, incorrect URLs, and server configuration issues require separate fixes.
Should I redirect all 404 pages?
No. Redirect only when there is a relevant replacement. A genuine missing page can return a 404 status.
Conclusion
Most unexpected WordPress 404 errors can be investigated by checking permalinks, server rewrite rules, page URLs, and plugin conflicts.
Start with the simplest solution: save your permalink settings.
If that does not work, examine your Apache or Nginx configuration and check whether the affected content still exists.
Regularly reviewing broken internal links and Google Search Console reports can help you identify problems before they affect more visitors.
Leave a Reply