Every post or page returns 404 except the home page and /wp-admin/
- Likely cause
- Rewrite rules not working
- Go to
- The permalink and server sections below
Fix a WordPress 404 Not Found: re-save permalinks, restore the default .htaccess block, enable mod_rewrite, add nginx try_files and rule out plugin conflicts.
A WordPress 404 Not Found on pages that exist usually means the rewrite rules that send pretty URLs to index.php are missing or not running. Re-save Settings > Permalinks, restore the default .htaccess block on Apache, make sure mod_rewrite and AllowOverride allow it, or add try_files $uri $uri/ /index.php?$args; on nginx. Then rule out a plugin.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
/wp-admin/When the request does reach WordPress and nothing matches, WordPress picks a template for it. Its template hierarchy documents the 404 template files and calls them in order, starting with 404.php. So a themed "page not found" screen means WordPress ran and found nothing; a plain server page means the rewrite never handed the request over.
In the dashboard, go to Settings > Permalinks and save, even without changes. WordPress's Common Errors guide says to reset permalinks this way for pretty permalink 404s. For custom post type 404s it says to select the default permalinks, save, then reselect your structure; that flushes the rewrite rules.
Pretty permalinks work through the rewrite block that WordPress writes to .htaccess. If the file is missing or corrupted, rename it to .htaccess_old, load the site, then re-save permalinks so WordPress writes a fresh one.
WordPress's troubleshooting guide says pretty permalink 404s can mean mod_rewrite is not activated, and tells you to look for the line # LoadModule rewrite_module modules/mod_rewrite.so in httpd.conf. A commented line means the module is off.
In the Apache config, AllowOverride must permit the directives in .htaccess. Apache's default is None, which means .htaccess files are ignored.
nginx has no .htaccess, so WordPress cannot write the rules for you. Add the try_files line to the main location block, as in the nginx snippet below.
# 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 WordPresslocation / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass php;
}The nginx guide in the WordPress handbook explains that, without server changes, nginx adds index.php to your permalinks. Its try_files line includes the ?$args part so that non-default permalinks that use a query string keep working. For the nginx side of a missing file, see 404 Not Found in nginx; for Apache, see 404 Not Found in Apache.
wp-content/plugins to plugins.hold using FTP or your host's file manager, log in, rename it back, and reactivate plugins one at a time. The same guide's steps for other errors also include switching to a default theme to rule out theme code. After a migration or server move, the permalink and rewrite settings are the first place to look.Open a post URL and a page URL in a private window.
curl -sI the URLs and confirm 200, not 404.
A made-up path should return 404 with your theme's 404.php design.
4 questions people ask next, answered from the sources on this page.
Go to Settings > Permalinks and save. If that fails, restore the default .htaccess rewrite block (Apache), confirm mod_rewrite and AllowOverride are on, or add try_files $uri $uri/ /index.php?$args; for nginx. Then deactivate plugins to rule out a conflict.
The home page can load without a rewrite, while posts and pages with pretty permalinks need the rewrite rules. They are missing, not refreshed, or not running on your server.
WordPress's Common Errors guide gives two steps. Make sure no custom post type and single page share the same name, renaming the page and its slug if they do. Then go to Settings > Permalinks, select the default permalinks, save, and reselect your preferred structure to flush the rewrite rules.
The server did not find a current representation for the requested URL, or is not willing to disclose that one exists. RFC 9110 does not say whether the condition is temporary or permanent.
Run the free audit, then approve the fixes. Every change can be undone.