Introduction

When WordPress pages turn into 404 errors after a permalink change, the problem is usually not missing content. More often, WordPress rewrite rules and the web server are out of sync. Recovery means rebuilding those rules cleanly and checking whether Apache or Nginx is actually honoring them.

Symptoms

  • Posts and pages start returning 404 immediately after a permalink update
  • The homepage still works while inner URLs fail
  • Opening a post with ?p=123 works but the pretty permalink does not
  • The issue appeared after migration, caching changes, or server config edits
  • Category, tag, or custom post type URLs also fail unexpectedly

Common Causes

  • Rewrite rules were not flushed after changing permalink settings
  • .htaccess was removed, blocked, or not writable on Apache
  • Nginx rules do not pass unknown URLs to index.php
  • Security or cache layers are serving stale routing behavior
  • Custom rewrite code from a plugin or theme conflicts with the new structure

Step-by-Step Fix

  1. Confirm the affected URLs and test whether the same content still loads with the default WordPress query-string format.
  2. Open WordPress permalink settings and save the current structure again to flush rewrite rules without changing the intended URL format.
  3. On Apache, inspect .htaccess and verify the standard WordPress rewrite block exists and is readable by the web server.
  4. On Nginx, confirm the site configuration routes unresolved requests through index.php instead of treating them as missing static files.
  5. Clear any page cache, CDN cache, or server cache so old routing behavior is not masking the result.
  6. Temporarily disable plugins that register custom rewrites if the failure affects only specific content types or taxonomies.
  7. Check file permissions and ownership if WordPress could not update .htaccess automatically during the permalink change.
  8. Re-test a homepage link, a post URL, a page URL, and a category archive after each correction.
  9. Keep permalink updates paired with server config review and a quick routing test so the next URL change does not break deep pages in production.