A 404 error means the requested page could not be found on the server. In WordPress, 404 errors on individual posts and pages are most commonly caused by broken permalinks or a corrupted .htaccess file. This guide covers the most common causes and how to fix them.
Method 1: Reset Permalinks (Most Common Fix)
This is the simplest and most effective fix for WordPress 404 errors on posts and pages:
- Log in to your WordPress Dashboard (
yourdomain.com/wp-admin). - Go to Settings → Permalinks.
- Without changing anything, scroll to the bottom and click Save Changes.
- Visit your website and test the pages that were returning 404 errors.
This regenerates the rewrite rules in the .htaccess file without changing your URL structure.
Method 2: Manually Repair the .htaccess File
If resetting permalinks does not work, the .htaccess file may be corrupted:
- Log in to cPanel.
- Go to Files → File Manager.
- Navigate to
public_html. - Find the
.htaccessfile. If you cannot see it, click Settings (top-right) and enable Show Hidden Files. - Right-click
.htaccessand select Rename. Rename it to.htaccess-old. - Go back to WordPress: Settings → Permalinks → Save Changes.
- WordPress will create a fresh
.htaccessfile with the correct rules.
The default WordPress .htaccess should contain:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Method 3: Check Plugin Conflicts
Some plugins (especially security, caching, or SEO plugins) can interfere with permalinks:
- In WordPress, go to Plugins → Installed Plugins.
- Deactivate all plugins.
- Check if the 404 errors are resolved.
- Reactivate plugins one at a time, testing your site after each activation.
- When the 404 error returns, the last activated plugin is the cause. Contact the plugin developer or find an alternative.
Method 4: Clear Your Cache
- Clear your browser cache (Ctrl+F5 or Cmd+Shift+R).
- If you have a caching plugin (WP Super Cache, W3 Total Cache, LiteSpeed Cache), clear its cache.
- If your site uses Cloudflare or a server cache, purge it from your hosting or CDN dashboard.
Common Causes of WordPress 404 Errors
- Changed permalink structure without saving permalinks.
- Plugin conflict after installing or updating a plugin.
- Corrupted .htaccess file.
- Migrated or restored the site without updating the database.
- Deleted posts or pages that are still linked in menus.
- Case sensitivity — Linux servers are case-sensitive (e.g.,
MyPagevsmypage).
Important Notes
- Your homepage working while other pages return 404 is a strong indicator of a permalink issue.
- Always back up your
.htaccessfile before making changes. - If none of these methods work, the issue may be server-level. Contact your hosting provider.
Troubleshooting
Permalink reset does not fix the issue:
- Check that the
.htaccessfile is writable (permissions set to644). - Verify that mod_rewrite is enabled on the server. Contact your hosting provider to confirm.
404 errors on custom post types only:
- The plugin that registers the custom post type may need updating.
- Go to Settings → Permalinks → Save Changes to flush the rewrite rules.
404 error after migrating to a new server:
- Update the site URL and home URL in the
wp_optionstable via phpMyAdmin. - Verify the domain DNS is pointing to the correct server.