Errors
404 on Every WordPress Page Except the Homepage
If your WordPress homepage loads but every other page shows a 404, the problem is usually not the content itself. In most cases, WordPress has lost its rewrite rules, your .htaccess file is wrong, or the server is no longer sending requests to WordPress correctly.
The safest first fix is to resave your permalinks and check for plugin, theme, or server-level changes that affect URL rewriting. If that does not solve it, you are likely dealing with a hosting or migration issue, and it is worth stopping before you make it worse.
What this symptom usually looks like
This problem has a very specific pattern: the front page works, but internal URLs fail. You may see 404s on blog posts, pages, category archives, or custom post type URLs. Sometimes the WordPress admin looks fine, and sometimes the site only breaks on certain paths such as /about/ or /blog/post-name/.
That pattern is important. It usually means WordPress is alive, but the server is not routing non-homepage requests to WordPress correctly.
The most likely causes
- Permalinks need to be flushed. WordPress rewrite rules can become stale after a migration, update, or change to permalink settings.
- .htaccess is missing or incorrect. On Apache-based hosting, a bad or absent .htaccess file can break pretty permalinks.
- Nginx rewrite rules are missing. On Nginx, WordPress depends on server config, not .htaccess, so a hosting change can cause 404s even when the homepage still works.
- A plugin or theme changed routing. Custom post types, language plugins, membership plugins, and SEO plugins can all affect URL handling.
- The site was migrated or restored incompletely. A database import, domain change, or partial restore can leave the homepage accessible while the rest of the routes fail.
- WordPress is installed in a subdirectory or behind a proxy. Incorrect Site Address, WordPress Address, or reverse proxy settings can produce partial routing failures.
Start with the safest fix: resave permalinks
This is the first thing to try because it is fast, low-risk, and often fixes the issue immediately. Before you change anything, take a backup if you have not already. If the site is already unstable, make sure you can restore it.
- Log in to WordPress admin.
- Go to Settings → Permalinks.
- Do not change anything yet. Just click Save Changes.
- Test a few internal URLs again.
This forces WordPress to regenerate rewrite rules. If the 404s disappear, the problem was stale routing data, not broken content.
Check whether .htaccess is the issue
If you are on Apache or LiteSpeed, a corrupted or overwritten .htaccess file is one of the most common reasons for this exact symptom. This can happen after a plugin update, security tool change, restore, or migration.
Before editing anything, back up the current file. Then inspect the file in the site root. A standard WordPress .htaccess for a site in the web root usually contains the default rewrite block below:
# 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
If that block is missing, mangled, or replaced by plugin rules that should not be there, restore the default version and save permalinks again. If WordPress lives in a subdirectory, the rules need to match that path, so do not blindly paste a root-level config into a different install.
If you are on Nginx, check the server config
Unlike Apache, Nginx does not use .htaccess. If your hosting provider moved the site to Nginx or changed the stack during a migration, WordPress may still load the homepage while every internal permalink returns 404.
The fix usually lives in the Nginx server block, not in WordPress admin. You want the standard WordPress rewrite handling in place, typically something that sends requests to /index.php when the file or directory does not exist. Because exact config varies by host, this is often a hosting-ticket fix unless you manage the server yourself.
If you are not sure whether the site is on Apache or Nginx, ask the host before changing anything. Guessing here can make a working homepage break too.
Rule out a plugin or theme conflict
Routing issues are often caused by a plugin that registers custom post types, rewrites, language directories, or membership gates. A theme can also alter URL behavior if it includes custom routing code.
Use the safest isolation method you have available. If you can work in a staging copy, do that first. If not, be careful and change one variable at a time.
- Deactivate all plugins except anything essential for login or site access.
- Test the broken URLs again.
- If the pages work, reactivate plugins one by one until the 404s return.
- Switch briefly to a default theme such as Twenty Twenty-Four if the issue is still unresolved.
If the site uses custom post types, pay attention to the plugin that created them. A plugin update can change rewrite settings without warning, which makes existing links appear broken even though the content is still in the database.
Check for a bad migration or wrong site URL
When the homepage works but inner pages do not, a partial migration is another strong possibility. The database may contain the correct content, but the server or WordPress settings may still point to the old location.
Check these values in Settings → General:
- WordPress Address (URL)
- Site Address (URL)
They should match the real live URL structure of the site. If the site moved from http to https, from one domain to another, or from a subfolder to the root, incorrect URL values can create inconsistent routing.
Also check whether the site has been placed behind a reverse proxy, CDN, or caching layer that rewrites requests. In some setups, the homepage may be cached and visible while uncached internal requests fail at the origin.
Do not overlook custom post type rewrite settings
If the broken pages are not standard pages or posts, the problem may be limited to custom content types. A custom post type registered with the wrong rewrite slug can generate URLs that look right but do not resolve.
This is especially common after:
- a plugin update that changed rewrite defaults,
- a theme switch that removed registration code,
- a migration where the custom post type plugin was not restored, or
- a change to permalink structure that was never flushed afterward.
If only custom post type URLs 404, verify that the plugin or theme that registers them is active, then resave permalinks. If the issue persists, the rewrite slug itself may need to be corrected in code.
How to confirm whether the server is at fault
If you have checked permalinks, .htaccess, plugins, themes, and site URLs, and the issue remains, the problem is probably server-side. That is especially likely if:
- the site recently changed hosts or server type,
- the homepage is cached but everything else fails,
- 404s happen for both public and logged-in users, or
- the same issue appears on a fresh default theme with all plugins off.
At that point, the fix is often in web server rewrite rules, file permissions, or a platform-level configuration issue that WordPress itself cannot repair. If your host has a managed WordPress panel, ask them to check rewrite handling and the application’s document root.
What not to do
- Do not reinstall WordPress just because the pages 404. That rarely addresses rewrite problems.
- Do not delete random database tables or replace core files blindly.
- Do not keep toggling plugins and settings without noting what changed.
- Do not edit server config unless you understand the hosting stack and have a rollback plan.
When a site is already partly broken, random changes make it harder to identify the real cause.
How to prevent this from happening again
Once the site is fixed, a few habits reduce the chances of a repeat:
- Keep a known-good backup you can actually restore, not just a backup job that has never been tested.
- After migrations, confirm the homepage, a post, a page, a category archive, and any custom post type URL all work.
- Save permalinks after major plugin, theme, or hosting changes.
- Document any plugin that adds custom routing so you know what to check first next time.
- Use staging for updates that affect permalink structure, multilingual routing, or custom content types.
If you want a broader safety net, a sensible backup and update routine is worth more than any single troubleshooting trick. This is also a good moment to review your restore process with A Sensible WordPress Backup Strategy You Can Actually Restore and What to Do When a WordPress Update Breaks Your Site.
When to call a professional
If you have already flushed permalinks, checked .htaccess or Nginx config, ruled out plugin and theme conflicts, and the site still throws 404s on every page except the homepage, it is time to stop guessing. That is especially true if the site is live, business-critical, or tied to recent migration work.
Mend can diagnose the routing issue quickly and fix it on a backup-first workflow, usually the same day for straightforward cases. If you need a clean handoff, a plain-English report of the root cause, and a fixed-or-refunded guarantee, start with free diagnosis. If the site is down enough that you need immediate help, use Emergency Rescue.
If you want someone to connect safely without sharing passwords, you can also use the free Mend Connect plugin.
Quick recap
When WordPress shows 404s on every page except the homepage, the cause is usually a rewrite problem, not missing content. Start with permalinks, then check .htaccess or Nginx config, then rule out plugins, themes, and migration mistakes. If those do not solve it, the issue is probably server-level and best handled by an engineer.
Frequently asked questions
Why does the homepage work but every other WordPress page 404?
The homepage can load even when WordPress rewrite rules are broken. Internal pages depend on server routing, so a bad .htaccess file, missing Nginx rewrite rules, or stale permalinks can break them while the front page still works.
Will saving permalinks fix this?
Often yes. Resaving permalinks flushes WordPress rewrite rules and is the safest first step. If it does not help, the issue is likely server config, a plugin conflict, or a migration problem.
Should I edit .htaccess myself?
Only if you are comfortable making a backup first and restoring the file if needed. On Apache or LiteSpeed, .htaccess is a common cause, but on Nginx it is not used at all, so the right fix depends on your hosting stack.
What if only custom post type URLs are broken?
Then the problem may be with the plugin or theme that registers those post types. Check that the code or plugin is still active, then flush permalinks again. If that fails, the rewrite slug may need to be fixed in code.