Skip to content
FunnelGuard

Fix guide by FunnelsGuard

WordPress permalink flush breaking URLs (404s): how to fix it

OPS-246High impactDetectedBy FunnelGuardPublished Updated
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.

Where a broken permalink stops the funnel
  1. Ad clickVisitor clicks a link to /landing/
  2. Landing pageServer returns 404 Not Found
  3. Form submitNever reached
  4. Thank-you page and trackingNo conversion recorded

The home page still loads, so the problem is easy to miss.

Leads per week before and after the breakExample numbers
Leads per week before and after the break (example)Normal week: 40 leads; Week with 404s: 6 leads01531406Normal weekWeek with 404sleads

Example: illustrative numbers for a site whose landing page returns 404 for a week.

How to check if your site has it

Quick checks
  • 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

Restore your rewrite rules
  1. Re-save permalinksWordPress

    Go to Settings > Permalinks and click Save Changes without changing anything. This flushes and rewrites the rules. Test a page again.

  2. 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.

  3. 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.

  4. 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.

  5. Clear caches

    Purge your caching plugin, server cache and CDN so old 404 responses are not served.

Server-level fixes
  1. Re-save permalinks

    Settings > Permalinks > Save Changes. If a notice says .htaccess is not writable, fix file permissions or copy the rules manually.

  2. 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.

Standard WordPress .htaccess block (Apache)htaccess
# 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
nginx location block for WordPressnginx
location / {
    try_files $uri $uri/ /index.php?$args;
}
Permalinks before and after the fix

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

Confirmation
  • 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

Prevention
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.