How to fix 404 errors on WordPress

404 errors on WordPress usually appear after you change your permalink structure, delete or rename posts, or migrate your site. WordPress has no built-in redirect manager, so here's how to fix 404s with a plugin or server config — and how to catch the ones you miss.

Why 404 errors happen on WordPress

  • You changed the permalink structure (Settings → Permalinks), so every old URL format now 404s.
  • Posts or pages were deleted, renamed, or had their slug changed.
  • You migrated domains, themes, or hosts and the URL paths changed.
  • Old external links or indexed Google results point to URLs that no longer exist.

How to fix 404 errors on WordPress, step by step

  1. 1

    Install a redirect plugin (easiest)

    Install the free 'Redirection' plugin (Tools → Redirection after activating), or use the redirect manager built into Rank Math or Yoast SEO Premium. This gives you a UI to manage 301s without touching server files.

  2. 2

    Add a 301 redirect

    In Redirection, enter the Source URL (the old broken path, e.g. /old-post/) and the Target URL (the new location), leave the type as 301, and save. Redirects apply immediately.

  3. 3

    Or edit server config (advanced)

    On Apache, add to .htaccess: 'Redirect 301 /old-path https://yoursite.com/new-path'. On nginx, add a 'rewrite ^/old-path$ /new-path permanent;' rule. Server-level redirects are the fastest but require file access.

  4. 4

    Test the redirect

    Open the old URL in an incognito window and confirm it 301s to the new page. Use the plugin's log to spot any remaining 404s hitting your site.

Automatically rescue every 404 on WordPress

Plugins only redirect URLs you've already mapped. Redirect Mapper adds a snippet to your theme's 404 template (404.php or header) that detects any 404 in real time and redirects the visitor to the closest live URL from your sitemap — no rules to write. It logs every broken URL so you can later add permanent redirects in your plugin or .htaccess.

Frequently asked questions

The free 'Redirection' plugin is the most popular dedicated option and handles 301s, 404 logging, and regex rules. If you already use Rank Math or Yoast SEO Premium, their built-in redirect managers work equally well, so you don't need a separate plugin.

Related guides