On this page
What this issue is
WordPress uses rewrite rules to turn a friendly address like /pricing/ into an internal request it can understand. Changing the permalink structure, or running a flush (for example by re-saving Settings > Permalinks, or a plugin calling flush_rewrite_rules()), regenerates those rules.
Common causes: .htaccess is not writable or was overwritten, Apache has AllowOverride None, nginx has no try_files fallback to index.php, a plugin or theme registers a custom post type after the flush runs, or a caching layer keeps serving old redirects.
Why it costs you leads or sales
A 404 on a landing page, thank-you page, checkout or form endpoint stops visitors dead. Paid clicks land on an error page, so you pay for traffic that cannot convert. Search engines also see the errors, and pages can drop out of results if the problem lasts.
- Ad clickVisitor clicks a link to /landing/
- Landing pageServer returns 404 Not Found
- Form submitNever reached
- Thank-you page and trackingNo conversion recorded
The home page still loads, so the problem is easy to miss.
Example: illustrative numbers for a site whose landing page returns 404 for a week.
How to check if your site has it
- Open your key landing pages in a private window. Do any show 404?
- Does the home page load while inner pages fail? That points to rewrite rules.
- Try the same page with
?p=123(the post ID). If it loads, the content exists and only rewrites are broken. - Check custom post types, category pages and WooCommerce pages (cart, checkout, my account).
- Look at Google Search Console > Pages for a spike in "Not found (404)".
- Check the server error log for "File does not exist" lines on pretty URLs.
How to fix it
Re-save permalinksWordPress
Go to Settings > Permalinks and click Save Changes without changing anything. This flushes and rewrites the rules. Test a page again.
Check the structureWordPress
Make sure the selected structure is what you expect (for example Post name). If you changed it recently, set it back and save.
Check the server rules
On Apache, confirm .htaccess has the WordPress block and is writable. On nginx, confirm the try_files line is present. See the tabs below.
Deactivate suspectsWordPress
If custom post types 404, temporarily deactivate recently updated plugins or themes that register them, re-save permalinks, then reactivate one by one.
Clear caches
Purge your caching plugin, server cache and CDN so old 404 responses are not served.
Re-save permalinks
Settings > Permalinks > Save Changes. If a notice says .htaccess is not writable, fix file permissions or copy the rules manually.
Flush from code if needed
Use WP-CLI: wp rewrite flush --hard. This is useful when the admin screen itself is unreachable or when custom post types are involved.
Apache: restore .htaccess
Add the standard WordPress block to .htaccess in the site root (see the code below) and make sure the virtual host has AllowOverride All and mod_rewrite enabled.
nginx: add try_files
In the location / block, use try_files $uri $uri/ /index.php?$args; then test the config and reload nginx.
Register post types on init
If you flush from code, do it once on plugin activation, not on every page load, and only after your post types are registered.
# 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 WordPresslocation / {
try_files $uri $uri/ /index.php?$args;
}Broken
- Home page loads, inner pages return 404
- .htaccess missing or empty
- Custom post types not found
- Ads land on an error page
Fixed
- Pretty URLs resolve normally
- Rewrite rules present and saved
- Custom post types load
- Landing pages and forms reachable
How to confirm it's fixed
- Open your top landing pages, thank-you page and checkout in a private window: each returns 200, not 404.
- Load a post, a category page and a custom post type URL.
- Submit your contact form and confirm the thank-you page loads.
- Check Search Console for the 404 count falling over the next days.
- Check the server log shows no new 404s for pages that should exist.
How to prevent it happening again
- Avoid changing the permalink structure on a live site without a redirect plan.
- Test plugin and theme updates on a staging copy, then re-check key URLs.
- Keep .htaccess writable by WordPress, or add the rules manually after server changes.
- After a migration, check the server config (Apache or nginx) carries the rewrite rules.
- Keep a list of your money pages and check them after every update or deployment.
- Set up 301 redirects if you must change URLs.
How FunnelGuard handles this
FunnelGuard detects this today. A robot visitor runs your real customer journeys on a schedule, so if a landing page, form page or thank-you page starts returning a 404, that step fails. A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause, by email, Slack, Teams, WhatsApp, webhook or PagerDuty.
Questions people ask
Why do my WordPress pages show 404 after changing permalinks?
WordPress rewrite rules were not saved or the server is not reading them. Re-save Settings > Permalinks, then check .htaccess (Apache) or the nginx try_files rule. Content is usually still there.
How do I flush permalinks in WordPress?
Go to Settings > Permalinks and click Save Changes. You can also run wp rewrite flush --hard with WP-CLI. Both regenerate the rewrite rules.
Why does saving permalinks not fix the 404 errors?
Usually the server is the problem. On Apache, .htaccess may not be writable or AllowOverride is off. On nginx, the try_files fallback to index.php is probably missing.
Why do my custom post types return 404?
The post type may be registered after the flush, or its plugin was deactivated or updated. Make sure it registers on init, then flush once and re-test.
Will changing permalinks hurt my SEO?
It can if old URLs stop working. Search engines will see 404s and may drop pages. Add 301 redirects from the old URLs to the new ones.
How can I tell if only rewrites are broken?
Open a page using its ID, such as yoursite.com/?p=123. If it loads while the pretty URL gives 404, the content exists and the rewrite rules are the problem.
How can I find out quickly when a page starts returning 404?
Use synthetic monitoring such as FunnelGuard, which runs your real journeys on a schedule and alerts you when a step fails. Search Console and server logs also show 404s, but usually later.
Related issues
- OPS-247Site URL wrong after migration (redirects to staging)Fix guide
- OPS-242WordPress core update breaking themeFix guide
- OPS-241Plugin conflict causing white screenFix guide
- OPS-239Caching plugin conflict (WP Rocket, LiteSpeed) breaking JSFix guide
- OPS-234Plugin auto-update breaks contact formFix guide
- OPS-251WP REST API disabled breaking block formsFix guide