How to Fix WordPress 404 Errors

Few things frustrate a site owner more than clicking a link and landing on a “Page Not Found” screen. A 404 error means the server could not find the page at the address requested, and when it appears across your site, it can cost you visitors, search rankings, and sales. The good news is that most WordPress 404 errors have simple causes: a permalink setting that broke, a damaged .htaccess file, a plugin conflict, or a page that moved without a redirect. This guide works through each cause in order, from the quickest fix to the deeper checks, so you can find your problem without guessing.
Before you change anything, take a quick backup of your site, or at least of your database. Most of the fixes below are safe, but a backup turns a stressful mistake into a five minute restore. If you are unsure how to back up, our guide on how to create a WordPress staging site without a plugin also covers the habit of testing changes safely before they touch your live site. With that safety net in place, start diagnosing.
What Does a 404 Error Actually Mean?
A 404 is an HTTP status code, which is the server’s way of saying the requested address does not match any content it knows about. It does not mean your whole site is down. Your homepage and other pages can work perfectly while one post, one category page, or one attachment returns a 404. That distinction matters, because a single broken link points to a problem with that specific page, while 404 errors on every post usually point to a site wide setting such as permalinks or the server rewrite rules.
Is the Problem Site Wide or Limited to One Page?
Your first diagnostic step takes less than a minute. Open your homepage: if it loads, your site itself is up. Then open three or four different posts and pages. If all of them return 404 errors while the homepage works, the cause is almost certainly your permalink settings or your .htaccess file, and the fixes in the next two sections will usually solve it. If only one page returns a 404 while everything else works, the problem is specific to that page: it may have been renamed, moved to trash, or given a conflicting slug.
How Do You Reset Permalinks to Fix 404 Errors?
Resetting permalinks is the single most effective fix for site wide 404 errors, and it takes under a minute. Permalinks are the permanent URL structure WordPress uses for your posts and pages, and WordPress stores rewrite rules based on that structure. When those rules get corrupted, perhaps after a plugin update, a migration, or a server change, WordPress can no longer match pretty URLs to the right content, so every post returns a 404 even though the content still exists in the database.
- Go to Settings, then Permalinks, in your WordPress dashboard.
- Note your current structure, then click Save Changes without changing anything.
- Saving flushes and rebuilds the rewrite rules, which fixes most permalink related 404 errors.
- If that does not work, switch temporarily to the Plain structure, save, then switch back to your original structure and save again.
- Test several posts and pages after each save to confirm the fix.
Saving without changing anything sounds too simple to work, but it forces WordPress to regenerate the rules, which is exactly what a corrupted ruleset needs. If you want to understand permalink structures better before choosing one, read our WordPress permalink structure guide, which compares the common structures and explains which one suits different kinds of sites.
How Do You Restore the Default .htaccess File?
On Apache servers, WordPress writes its rewrite rules into a file called .htaccess in your site root folder. If that file gets damaged, truncated, or overwritten by another plugin, the rewrite rules disappear and pretty permalinks stop working, which produces site wide 404 errors. Restoring the default file is straightforward, but edit it carefully, because a syntax error in .htaccess can bring down your whole site with a server error instead of a 404.
First, download a copy of your current .htaccess file through your hosting file manager or FTP, so you can restore it if needed. Some security and caching plugins add their own rules to this file, so keep that backup to compare against later. Then replace the WordPress section with the default block below. Note that the two lines with a lone hyphen are passthrough rules that tell Apache to leave the request unchanged, and WordPress regenerates this block automatically whenever you save your permalink settings.
# 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
After saving the file, visit several posts and pages. If the 404 errors are gone, the damaged file was your problem. If your site now shows a 500 server error instead, restore your backup copy of the file immediately and check for a typo or an extra character you may have introduced. If your host uses nginx instead of Apache, there is no .htaccess file at all: nginx uses server level rewrite rules, so a site wide 404 problem on nginx usually needs your host’s help, which is covered in the final section.
Could a Plugin or Theme Be Causing the 404 Errors?
Plugins that touch URLs are frequent suspects: redirection plugins, SEO plugins, caching plugins, and security plugins can all rewrite or block addresses. A theme can cause the same problem if it registers custom post types or taxonomies incorrectly. The classic conflict test is simple but must be done carefully on a live site, so a staging copy is the safest place for it. Our staging guide shows how to set up a staging site without a plugin if you do not have one yet.
- Deactivate all plugins, then test the broken pages. If they work, a plugin is responsible.
- Reactivate plugins one at a time, testing the pages after each one, until the 404 errors return.
- That last plugin is your culprit: check its settings, update it, or replace it.
- If plugins are not the cause, temporarily switch to a default theme such as Twenty Twenty-Four and test again.
- If the default theme fixes the errors, your theme’s URL handling needs attention from its developer.
On a busy live site, deactivating every plugin at once can briefly break visible features, so do this during a quiet period and work quickly. An alternative is a health check plugin that lets you troubleshoot with plugins disabled only for your own session, leaving the live site untouched for visitors. Either way, once you find the culprit, do not simply leave it deactivated forever if it provided an important feature: look for an updated version, a settings fix, or a replacement that does the same job without breaking URLs.
Did the Page Move, Get Renamed, or Get Deleted?
When only one page returns a 404, check its status inside WordPress. Open Posts or Pages and search for the title. The page may be sitting in trash, in draft, or set to private, all of which make its public URL return a 404. Restoring it from trash or publishing it again fixes the error immediately. Also check the slug, which is the URL friendly version of the title. If you renamed a post, its slug changed, and every old link to the previous slug now returns a 404.
Slug conflicts cause subtler problems. WordPress appends a number when two posts share a slug, so a post you expected at one address may actually live at an address ending in a number. Check the exact slug in the editor and compare it with the address that returns the 404. If the content moved permanently, set up a redirect from the old address to the new one. A redirect sends visitors and search engines to the right page automatically and preserves most of the old page’s search value, which is far better than leaving a dead end.
How Do You Redirect Moved Content?
Redirects are the correct fix for any page that moved, merged, or changed address. A 301 redirect tells browsers and search engines that the move is permanent, so they update their records and pass visitors along without a visible error. Most SEO and redirection plugins offer a simple form: enter the old address, enter the new address, choose 301, and save. Test the old address after saving, and confirm it lands on the new page instead of a 404. The official documentation at developer.wordpress.org explains how WordPress handles URLs and rewrite rules under the hood.
Could Caching Be Showing You an Old 404 Page?
Sometimes the page is already fixed, but you keep seeing the 404 because a cached copy is being served. Caching happens in several layers: your browser, your caching plugin, your CDN, and sometimes your host. Clear them in order, testing after each layer. Start with a private browser window, then clear your browser cache, then purge the cache in your caching plugin, then purge the CDN cache if you use one. If the page works in a private window but not your normal browser, browser cache was the whole problem.
When Should You Contact Your Hosting Provider?
If you have reset permalinks, restored .htaccess, ruled out plugins and themes, and cleared every cache, yet 404 errors persist, the problem is probably at server level, and that is your host’s territory. Contact support with a clear summary: which addresses return 404 errors, whether the problem is site wide or limited to certain pages, and which fixes you already tried. That summary saves several rounds of back and forth and gets you to a server specialist faster. A host with strong support makes this step far easier, which is why our web hosting guide weighs support quality alongside price. If the whole site goes blank during troubleshooting instead of showing 404 errors, switch to our guide on how to fix the WordPress white screen of death, since a blank screen is a different problem with different fixes.
Frequently Asked Questions
Will resetting permalinks delete my posts or change my URLs?
No. Resetting permalinks only rebuilds the rewrite rules WordPress uses to match addresses to content. Your posts, pages, and their addresses stay exactly the same. It is one of the safest fixes you can try, which is why it is the first step for site wide 404 errors.
Why do only my blog posts return 404 errors while pages work?
That pattern usually points to a plugin or theme that registers a custom post type or changes the post URL structure. Run the plugin conflict test described above, and check whether the problem started right after installing or updating a particular plugin. A permalink reset also helps when the rewrite rules for posts specifically are out of date.
Do 404 errors hurt my search rankings?
A few 404 errors on removed pages are normal and do not harm your site. Large numbers of 404 errors on pages that should exist are a problem, because search engines cannot index content they cannot reach, and visitors who hit dead ends leave quickly. Fixing broken internal links and redirecting moved pages protects both rankings and user experience.
Should I use a plugin to monitor 404 errors?
Yes, for an established site it is worth it. A redirection or SEO plugin can log every 404 address visitors hit, which shows you exactly which old links still get traffic. Fix the addresses that receive real visits first with redirects or restored pages, and ignore one off hits from bots probing random addresses, since those will never stop entirely.
Last updated: November 2026.



