rawatweb

WordPress 404 After Changing Permalinks: How to Fix It

Wordpress 404 after changing permalinks: every page returns 404 after a permalink change? Rebuild your rewrite rules without losing traffic.

An editorial view of WordPress URLs changing shape, with redirect and 404 markers.

You changed the URL structure from /?p=123 to /article/article-name/, or removed the date segment from permalinks. The homepage still loads, but the moment you click an article you get “Not Found”. Sometimes every page except the homepage returns 404.

Changing permalinks is one of the highest-impact SEO decisions you can make, and one of the easiest to turn into a site-wide 404. The good news: in many cases the cause is simple and fixable without touching a single word of content. The bad news: left for a few days, old indexed URLs drop out of search results and take far longer to recover.

Short answer: resave Settings → Permalinks so WordPress rewrites its rules, then check the server configuration for pretty permalinks. Once pages load again, add 301 redirects from the old URLs to the new ones and resubmit the sitemap. Do not keep changing the structure to “try” things—every change raises the risk.

Understand what actually changes

WordPress does not store a physical file per article. URLs such as /article/article-name/ are translated into database queries by rewrite rules. Those rules live in the database and, on many servers, also depend on server configuration (for example mod_rewrite on Apache or try_files on Nginx).

When you change the permalink structure, WordPress normally rewrites the rules automatically. Several conditions stop that from working:

  • Rules are not fully refreshed because the save process was interrupted.
  • A caching plugin serves old pages, making it look like the problem persists.
  • The server does not support pretty permalinks—for example mod_rewrite is disabled.
  • .htaccess is not writable, so new rules are never stored.
  • The Nginx configuration does not pass requests to index.php, so every pretty URL looks like a missing file.

So the first step is not to change the theme or disable plugins; it is to verify that rewrite rules were actually refreshed and that the server supports them.

This sounds like a cliché, but it resolves the majority of cases:

  1. Open Settings → Permalinks.
  2. Without changing anything, click Save Changes.
  3. Clear the plugin cache, the host cache, and the CDN cache.
  4. Open an article in an incognito window.

Why does it work? Saving that screen forces WordPress to flush and rewrite its rules, including rules for custom post types and taxonomies that may not have been registered yet. Often the rule for a new article was never added, or an old rule still points at the previous structure.

If only one or two pages return 404 after this, the cause is not permalinks but those pages themselves—a draft, a duplicate slug, or a deleted post.

When the whole site returns 404

If the homepage loads but every other page 404s, focus on the server:

Apache: confirm mod_rewrite is enabled and AllowOverride permits .htaccess. Check that .htaccess contains the standard WordPress block. If the file is missing, WordPress cannot write rules and pretty permalinks will never work.

Nginx: WordPress does not use .htaccess. Requests must be routed to index.php via try_files. If that configuration was lost after a server migration, every pretty URL returns 404 even though WordPress itself is fine.

Custom hosting panels: some panels manage rewrites at a different layer. If you are unsure, ask the host—they can usually tell you whether the request reaches WordPress or is rejected earlier.

Cache and CDN: 404 pages can be cached. After fixing the rules, purge caches thoroughly, including cached error pages.

To separate server issues from WordPress issues, test the query-string URL: yourdomain.com/?p=123 (replacing 123 with a post ID). If the query version opens but the pretty version 404s, the problem is almost certainly rewrite rules, not the database.

When only some articles or categories 404

This pattern points to something more specific:

  • A custom post type was just registered and its rules have not been created. Resave permalinks after the plugin or theme that registers it is active.
  • A category or tag whose slug collides with a page slug. WordPress can become confused and one of them ends up 404.
  • Duplicate article slugs, for example two posts with the same title. WordPress appends -2 to the newer one, so the URL you expected does not exist.
  • A parent page that was deleted or renamed, breaking child URLs.
  • An SEO plugin that rewrites permalinks at an extra layer; its settings must be updated after the change.

How to check: open the post list, look at the slug column, and compare it with the failing URL. Do not guess from the title, because the slug can differ.

Fixing the 404 is only half the job. Once the new URLs work, old URLs that are indexed by search engines and shared by people still point at an empty page. Every dead old URL is traffic and authority lost.

What to do:

  1. Map old URLs to new ones. For structural changes that follow a pattern, the mapping can be a rule rather than a manual list.
  2. Use 301 redirects, not 302, because the change is permanent.
  3. Test the redirects with a tool or curl -I to confirm the status and destination.
  4. Avoid redirect chains. One hop straight to the final destination is better for crawlers and visitors.
  5. Resubmit the sitemap once all new URLs are stable.

For small sites, a redirect plugin is enough. On sites with hundreds of URLs, manual mapping is error-prone; consider pattern-based rules at the server or CDN level, or help from a developer. The important part: do not guess. Pull the old URL list from analytics, Search Console, or an old sitemap if one is still available.

Remember that redirects at server, CDN, and plugin level can stack. If the end result is a loop, simplify: keep rules in one place and disable the others.

Anticipate the SEO impact

A permalink change is a signal change. Even with correct redirects, expect an adjustment period:

  • Rankings may move up and down for days or weeks.
  • Pages without redirects drop out of the index and take time to be replaced.
  • Backlinks pointing at old URLs keep working while redirects exist—so do not strip those rules a year later without checking.
  • The old sitemap in Search Console may report errors; submit the new one and let Google process it.

If organic traffic is your main acquisition channel, do not change URL structure at the same time as another major change—a full redesign or a hosting migration. Afterwards it becomes difficult to tell what caused a drop.

For comparison, pages that do not appear in Google often have entirely different causes, covered in why your website is not showing on Google.

A few ground rules I use before changing URL structure on client sites:

  • Decide the structure once, then keep it. Cosmetic URL changes almost never justify the risk.
  • Avoid dates in URLs if content will be updated and you want the URL to stay relevant.
  • Use short, descriptive slugs, without repeated words.
  • Back up the database before major changes. You can restore permalink settings if the result is a mess.
  • Work on staging first, especially when the site has a store or integrations that depend on URLs.
  • Record the change and its date, so another team member does not alter it again without coordination.

On sites managed by several parties, URL structure belongs in a written policy rather than an ad-hoc decision. When site management is split between vendors, this usually falls under website management services that set shared technical standards.

Backing up before changing permalinks is not a formality. Wrong rewrite rules can take the whole site down to 404, and restoring the previous settings from a database backup is far faster than guessing. The basics are in backups you can actually restore.

A short check order

If you are facing 404s after a permalink change right now, this sequence usually resolves it within minutes:

Wordpress 404 after changing permalinks usually clears once the permalink screen is resaved and the rewrite rules are flushed.

  1. Resave Settings → Permalinks.
  2. Clear plugin, host, and CDN caches.
  3. Test the query-string URL (?p=ID) to separate server from WordPress.
  4. Check mod_rewrite/try_files and the presence of .htaccess.
  5. Confirm there are no duplicate slugs or page conflicts.
  6. Add 301 redirects for old URLs.
  7. Resubmit the sitemap and watch Search Console for a week.

If steps 1–5 are done and 404s persist, a server configuration is usually involved, and the server log will tell you what cannot be inferred from the WordPress dashboard.

After a permalink change, WordPress must rewrite its rewrite rules; many 404s disappear simply by saving the Permalinks screen again. If 404s hit the whole site, check the server configuration (mod_rewrite or Nginx try_files) before blaming themes or plugins. Plugin has to be checked before conclusions are drawn, so the fix lands in the right place.

Frequently asked questions

Does changing permalinks delete my content? No. Content stays in the database; only the addresses change. The risk is that old URLs lose visitors and rankings unless redirects are added.

Why does only the homepage load? That is the classic pattern of a server that does not pass pretty URLs to WordPress. Check mod_rewrite or try_files, then resave permalinks.

Do I need a redirect plugin? For small sites a plugin is sufficient and easier to audit. On large sites, pattern-based rules at the server or CDN layer are cleaner and faster.

How long until rankings recover after redirects? It varies, usually days to weeks. It depends on how quickly Google finds the redirects, the quality of the destination, and whether other changes happened at the same time.

If the URL change involves hundreds of pages, or a site that takes orders daily, plan it deliberately. A free audit can map the URLs at risk, and the website maintenance pricing shows what it costs to fold work like this into routine care.

Read next: WordPress Emails Not Being Delivered: What to Fix, Image Upload Fails in WordPress: Causes and Fixes, Can’t Log In to WordPress Admin? Check These First.

#wordpress 404 #permalinks #rewrite rules #redirect old urls
Let's talk about your website

Does any of this look like your website?

Tell us on WhatsApp. We look first, explain what needs fixing, then you decide. For a fuller picture, request the free audit.

Chat with us