404 errors in WordPress are frustrating for both you and your visitors. A 404 means “page not found” — the URL was requested but WordPress can’t locate the content. They’re surprisingly common and, in most cases, easy to fix.
This guide covers every type of WordPress 404 error and the exact steps to resolve each one.
Types of WordPress 404 Errors
There are two main categories:
- Site-wide 404 errors — your entire website returns 404, often right after installation or a migration
- Individual page 404 errors — specific pages or posts return 404 while the rest of the site works fine
Fix #1: Refresh Permalinks (Most Common Fix)
The most common cause of 404 errors in WordPress is a corrupted or outdated permalink structure. The fix takes 10 seconds:
- Log into your WordPress dashboard
- Go to Settings → Permalinks
- Without changing anything, click Save Changes
This flushes the rewrite rules and regenerates your .htaccess file. This single step fixes the majority of WordPress 404 errors immediately.
Fix #2: Check Your .htaccess File
If refreshing permalinks doesn’t work, your .htaccess file may be corrupt or missing. Connect via FTP and check if .htaccess exists in your root directory. If it’s missing, create a new file with this content:
# 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
Upload this file to your WordPress root directory and test your site.
Fix #3: Enable mod_rewrite on Your Server
WordPress needs Apache’s mod_rewrite module to handle pretty permalinks. If it’s disabled, all internal links will 404. Contact your hosting provider to confirm it’s enabled, or check your hosting panel under Apache modules.
Fix #4: Fix 404 Errors After Site Migration
If you recently moved your WordPress site to a new domain or server, 404 errors commonly appear because:
- The site URL in database still points to old domain — fix this in Settings → General
- Old .htaccess file references old paths — regenerate via Permalinks page
- Incorrect file transfer — reupload your WordPress files
Use the Better Search Replace plugin to update old domain references throughout your database.
Fix #5: Deactivate Conflicting Plugins
Some plugins (especially security plugins and custom URL handlers) can interfere with WordPress routing and cause 404 errors. Deactivate all plugins and test. If 404s disappear, reactivate one by one to identify the culprit.
Fix #6: Fix Individual Post/Page 404 Errors
If specific posts are returning 404 while others work fine:
- Open the post in editor and re-save it (forces permalink regeneration for that post)
- Check the slug for special characters or unusual formatting
- Verify the post status is “Published” not “Draft”
- Check post type — custom post types may need permalink rewrite registration
Fix #7: Check for Category or Tag URL Conflicts
If a category slug matches a page slug (e.g., a category named “services” and a page named “services”), WordPress gets confused and returns 404 for one of them. Rename either the category or the page slug.
Redirect Old 404 URLs
For pages that have been permanently removed or whose URLs have changed, set up 301 redirects to direct old URLs to new ones. Install the Redirection plugin (free) to manage all your redirects easily without touching any code.
Find All 404 Errors on Your Site
To identify every 404 error on your site:
- Google Search Console — Coverage report shows all 404s Google has found
- Screaming Frog SEO Spider (free up to 500 URLs) — crawls your site and lists all errors
- Redirection plugin — logs all 404s visitors encounter in real time
Need Help Fixing WordPress Errors?
At debrajx, we diagnose and fix WordPress errors fast. Whether it’s 404s, broken pages, or more complex technical issues, contact us for a quick resolution.
Fix 4: WordPress 404 on Posts After Moving to a New Host
After migrating your WordPress site to a new server, 404 errors on posts and pages are very common. The new server doesn’t automatically know your permalink structure.
The solution: Go to Settings → Permalinks and click Save Changes — even without changing anything. This forces WordPress to regenerate the .htaccess rewrite rules on the new server. Do this immediately after every migration.
Fix 5: Custom Post Type 404 Errors
If you’re using a plugin that creates custom post types (portfolios, events, products, team members) and those pages return 404, the rewrite rules for that custom post type haven’t been registered.
Fix: Go to Settings → Permalinks and save. This flushes all rewrite rules including custom post types. If that doesn’t work, deactivate and reactivate the plugin that creates the post type.
Fix 6: WordPress 404 on Multisite Subsite
On WordPress Multisite setups, 404 errors often occur when the .htaccess isn’t configured for Multisite. Your .htaccess should contain Multisite-specific rules. Here’s the correct .htaccess for a subdirectory Multisite:
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
RewriteRule . index.php [L]
How to Find and Redirect Broken Links Causing 404s
Every 404 error is a bad user experience and a wasted SEO opportunity. If you’ve changed your URL structure or deleted old posts, those URLs keep getting traffic — and showing 404 pages.
Use the free Redirection plugin by John Godley to:
- Monitor 404 errors happening on your site in real-time
- Create 301 redirects from old URLs to new pages
- Import a CSV of redirects in bulk
- Automatically redirect when you change a post slug
Install it from Plugins → Add New, search for “Redirection”, install and activate. Then go to Tools → Redirection to see all 404 errors being logged.
WordPress 404 Errors: Prevention Checklist
- ✅ Always set a permalink structure before publishing your first post
- ✅ Install Redirection plugin to catch broken links early
- ✅ After any migration, visit Settings → Permalinks and save
- ✅ Don’t change slug/URL of published posts that already have backlinks
- ✅ If you must change a URL, always set up a 301 redirect from the old URL
- ✅ Check WordPress error logs in cPanel → Error Logs if 404s persist
Getting 404 errors you can’t fix? Get in touch — we’ll diagnose and fix WordPress errors for you quickly.