How to Fix WordPress 404 Errors on Every Page
Your homepage loads fine, but every other page throws a “404 Not Found” error. Take a breath – your site isn’t broken, and your posts aren’t gone.
The fix takes 30 seconds and doesn’t require any code. Go to Settings > Permalinks and click Save Changes. That’s it. Most of the time, that one click brings every page back.
Here’s why it works, what to do when it doesn’t, and how to stop a WordPress 404 error on all pages from wrecking your afternoon again.
Why is my WordPress site showing 404 on every page?
When your homepage works but clicking any link throws a 404, WordPress is getting confused about how to translate pretty URLs into actual posts.
Behind the scenes, WordPress keeps a tiny instruction sheet called rewrite rules. These rules tell your server that yoursite.com/about-me/ really means “load the About Me page.” When that instruction sheet goes stale or gets overwritten, every URL except the homepage stops working.
This happens after 4 common events: migrating your site to a new host, changing your permalink structure, a plugin modifying your .htaccess file, or a failed WordPress update. The posts and pages themselves are safe in the database. WordPress just forgot how to find them.
That’s why the fix is so quick. You’re not repairing anything – you’re handing WordPress a fresh copy of the instruction sheet.
How do I fix 404 errors in 30 seconds?
This is the fix that solves the wordpress 404 error all pages problem about 80% of the time. It’s built right into the dashboard.
Step 1: Log in to your WordPress dashboard
Go to yoursite.com/wp-admin and log in. Your admin area should still work even when the frontend is throwing 404s. If you can’t reach the admin either, skip down to the .htaccess section below.
Step 2: Open the Permalinks settings
In the left sidebar, click Settings > Permalinks. You’ll see a page with radio buttons for different URL structures (Plain, Day and name, Post name, and so on).

Step 3: Click Save Changes
Don’t change anything. Just scroll to the bottom and click the blue Save Changes button.
That click is the whole fix. WordPress regenerates its rewrite rules and updates your .htaccess file with fresh instructions. Open your site in a new tab and click around – every page should load now.
What did that actually do?
Saving the Permalinks page triggers something called “flushing the rewrite rules.” Don’t let the word flushing scare you – nothing gets deleted.
Flushing means WordPress rebuilds its URL map from scratch. It looks at your current permalink setting, figures out the correct pattern for each post and page, and writes those rules into your .htaccess file. The old stale rules get replaced with working ones.
Think of it like printing a new map after the road signs changed. Your destination hasn’t moved, but you needed updated directions to find it.
What if the permalinks fix didn’t work?
If Save Changes didn’t bring your pages back, something’s preventing WordPress from writing to your .htaccess file. You’ve got 3 follow-up checks.
Check 1: Fix the .htaccess file manually
Your .htaccess file sits in the root folder of your WordPress install. It’s a tiny text file that tells your server how to handle URL requests. When it gets corrupted or goes missing, no amount of Permalinks saving will help.
You’ll need to access it through your host’s File Manager or an FTP client. Open the File Manager in your hosting control panel (cPanel, Plesk, or your host’s custom dashboard), navigate to your site’s root folder (usually public_html or www), and look for a file called .htaccess. If you don’t see it, enable “Show hidden files” in the File Manager settings.

Before touching anything, back up your site or at least download a copy of the current .htaccess. Then replace the contents with this default WordPress code:
# 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
Save the file, then load your site. If the 404s are gone, the old .htaccess was the culprit.
Check 2: Deactivate plugins in bulk
Some security plugins and caching plugins rewrite .htaccess rules that conflict with WordPress. iThemes Security, WP Rocket, and W3 Total Cache are 3 common offenders when configured aggressively.
Go to Plugins > Installed Plugins, check the box at the top to select every plugin, pick Deactivate from the bulk actions dropdown, and click Apply. Then reload your site. If the 404s disappear, reactivate plugins one at a time until you find the conflict.
When you identify the culprit, check its settings for options labeled “Hide login URL,” “Custom permalinks,” or “Block XML-RPC.” One of those is usually the switch causing the conflict.
Check 3: Switch to a default theme temporarily
Rarely, a custom theme with broken page templates can cause site-wide 404s. Go to Appearance > Themes and activate Twenty Twenty-Four (or any default WordPress theme).
If your site suddenly works, the problem lives inside your current theme. Contact the theme developer or switch to a different theme. I wrote about a related issue in fixing global template changes ruining your site if your theme edits started breaking things recently.
Why is my WordPress site showing a 404 error on just one page?
If only one or two pages throw 404s while the rest of your site works fine, this is a different problem. The rewrite rules are healthy – something specific happened to those individual pages.
The post was deleted or moved to Trash. Go to Posts > All Posts and click the Trash tab. If your missing page is there, hit Restore. This is the most common reason a single URL stops working. I covered the broader case of WordPress blog posts disappearing separately.
The slug got changed. Every post has a URL ending called a slug. If you edited a post title and WordPress auto-updated the slug, or if you manually changed the slug, the old URL now points to nothing. Edit the post, click the URL in the right sidebar, and set the slug back to the original.
The post status changed to Draft. Published posts are public. Draft posts return a 404 to visitors (you can still see them while logged in). Check the post editor and make sure the status shows Published, not Draft or Pending Review.
The category or tag archive is empty. If you deleted all posts in a category, the /category/whatever/ URL will 404. Add a post to that category or delete the empty category.
What about redirecting the old URL?
If a page’s slug legitimately needed to change (like fixing a typo), don’t leave the old URL broken. Set up a redirect so anyone with the old link lands on the new page.
The free Redirection plugin handles this in 30 seconds. Install it, go to Tools > Redirection, enter the old URL in the Source field and the new URL in the Target field, and click Add Redirect. Visitors (and search engines) following the old link will bounce to the new one automatically. If you’re already using an SEO plugin like Rank Math or Yoast, they include redirect managers too – no need to stack a third plugin.

How do I stop 404 errors from happening again?
Most site-wide 404 outages come down to 3 habits that prevent them entirely.
Always save Permalinks after migrating. Moving your site to a new host or changing your domain? The first thing to do after the move is log in and hit Settings > Permalinks > Save Changes. Do it before you test anything else. It takes 5 seconds and avoids a panic.
Back up before changing permalink structure. Switching from Plain (?p=123) to Post name URLs is a good upgrade, but test it on a fresh backup first. If something misfires, you can restore in 2 minutes instead of debugging for 2 hours.
Keep plugins updated. Outdated security and caching plugins sometimes write bad .htaccess rules. Updates from the plugin authors usually fix these bugs fast. I wrote a guide on updating plugins without breaking your site that covers this safely.
Avoid editing .htaccess directly unless you have to. If you must edit it, keep a backup copy. One stray character in that file can knock your whole site offline, and 404s are usually the first symptom. Badly configured caching plugins can also be behind why your site is running slow as well as 404s – two problems with one cause.
Quick checklist
Here’s the fix-it order I run through when a client calls me with a wordpress 404 error all pages issue:
- Log in to WordPress, go to Settings > Permalinks, click Save Changes (fixes 80% of cases)
- If that fails, reset
.htaccessto the default WordPress code - Deactivate all plugins and reactivate one at a time to find conflicts
- Switch to a default theme to rule out theme problems
- For single-page 404s, check the Trash, check the slug, and check the post status
Most of the time, step 1 is the only step you’ll need. The rest are backup plans. While you’re tidying up, it’s also worth checking that none of your menu items got accidentally nested – see preventing accidental dropdown menus for that fix.
Frequently Asked Questions
Why are all my WordPress pages showing 404 except the home page?
I’ve found this almost always happens when your .htaccess file is missing or corrupted. Since the home page is a physical file, it loads fine, but all your other 50+ pages need that file to tell the server where to look.
How do I fix a 404 error on all pages?
My favorite 10-second fix is to flush the permalinks. I just go to Settings > Permalinks in my dashboard and click “Save Changes” without touching anything else. That forces WordPress to rewrite its routing rules and usually fixes the problem instantly.
What if saving permalinks doesn’t work?
If that doesn’t do the trick, I usually check for plugin conflicts next. I’ll temporarily disable my caching or security plugins, as they sometimes write bad rules to the server. If your site starts working after that, you’ve found the culprit.
Can a plugin cause a sitewide 404 error?
Absolutely. I’ve seen security plugins and caching tools break a site’s routing rules by adding conflicting code to the .htaccess file. Turning off those 2 types of plugins is the quickest way to test if they’re causing the headache.
That’s the full playbook. Next time your WordPress site throws 404s on every page, start with Settings > Permalinks > Save Changes. Nine times out of ten, you’re back online before your coffee gets cold.