A WordPress URL change maps an old address through a permanent redirect to a new address while internal links and 404s are checked

Editorial illustration; the URLs and WordPress-style interface are representative, not a live dashboard.

Changing a WordPress URL looks like a five-second edit in the post sidebar, and that is usually how links break. You clean up a clunky slug, hit Update, and move on—until a client emails a screenshot of a 404 page from last year’s PDF brochure, or Google keeps sending traffic through a messy chain of temporary redirects.

The real task is not renaming the slug. It is deciding what happens to every old address that bookmarks, search results, WhatsApp messages, and external sites still point to. Treating even a single URL change like a small migration—map the old path, put one direct 301 redirect in place, update the links you own, and verify the response while logged out—prevents almost all of the usual fallout.

Deciding Whether a URL Should Change at All

A URL change makes sense when the current path is genuinely misleading, carries an obsolete product or year slug, or needs to be merged into a stronger page. It is rarely worth the churn just because a shorter slug looks tidier in the editor. A stable URL is a usability feature in its own right.

Before touching the permalink field, decide which of three things is actually happening:

  • Move: the same content is getting a clearer address, so the old path should redirect permanently to the new one.
  • Merge: two overlapping pages are becoming one, so the retired page should redirect to the surviving page.
  • Retire: the content is gone with no relevant replacement, in which case returning a clean 404 or 410 is better than dumping visitors onto the homepage.

For sites with complex block themes or shared layouts, the template-parts guide is a useful reminder that page identity and shared layout structure are separate things. Changing a URL should alter the route deliberately without disturbing shared headers, footers, or query loops.

Building a Simple URL Map First

Open a spreadsheet or a plain Markdown table with four columns: old URL, final URL, reason, and test status. Include trailing slashes and any query parameters or language prefixes (/ms/, /en/) that affect routing.

Do not rely solely on what the WordPress editor shows. Check the live public URL in a private window, inspect the <link rel="canonical"> tag in the rendered HTML, and search your navigation menus, older posts, and downloadable PDFs for references to the old path. If the old URL already redirects somewhere, trace the full chain first so you do not stack a second hop on top of it.

Making the Slug Change Reversible

Back up the database before editing permalinks, especially if the change involves a taxonomy base, a WooCommerce product base, or a custom post type rewrite. On a live site without staging, make the change during a quiet window with your URL map open.

WordPress does try to help in one narrow case: when you change the slug of a published post, it stores the previous slug in the _wp_old_slug post meta field and uses wp_old_slug_redirect() to forward visitors. That automatic fallback is convenient, but it is brittle—it does not cover custom post types reliably, breaks if another post later claims that old slug, and does not help with category or page hierarchy changes.

After saving the new slug, open the public URL in a logged-out browser. Logged-in admin sessions often bypass page caching and hide permission or rewrite issues. If you changed a permalink structure or custom post type rewrite rather than a single post slug, visit Settings → Permalinks and click Save Changes to flush WordPress rewrite rules.

Adding One Direct Permanent Redirect

Do not rely on redirect_canonical() or WordPress’s old-slug guesswork as your long-term redirect layer. Configure an explicit 301 permanent redirect from the old path to the final destination.

Where that rule lives depends on your stack:

  • Nginx: If you control the server block, a single exact-match rule is fast and doesn’t touch PHP at all:
location = /services/old-package/ {
    return 301 https://$host/services/managed-wordpress/;
}
  • Cloudflare: If the domain sits behind Cloudflare, a Redirect Rule or Bulk Redirect handles the 301 at the edge before the request ever hits your origin server.
  • WordPress plugin: If you are on managed hosting without server config access and already maintain a redirect plugin (such as Redirection), add the rule there. Avoid installing a brand-new plugin solely for one or two redirects.

Keep the hop count at one:

old URL → 301 → final URL

Never chain old URL → temporary URL → category URL → final URL. Chains waste crawl budget, slow down mobile visitors, and make future debugging painful.

Redirects are for external links, bookmarks, and old shares you cannot edit. On your own site, update internal links directly so visitors and crawlers go straight to the new address.

If you have SSH and WP-CLI access, run a dry-run search first to see where the old path appears in post content:

wp search-replace 'https://example.com/old-slug/' 'https://example.com/new-slug/' --dry-run

Inspect the affected tables carefully before running it without --dry-run, and remember that WP-CLI won’t catch hardcoded paths inside theme templates, static HTML widgets, or Cloudflare rules. Check those manually:

  • primary navigation menus and footer columns;
  • Query Loop or related-post blocks using manual URLs;
  • XML sitemaps and RSS feed links;
  • email templates, active ad campaigns, and Linktree/social bio links.

Testing the Response from Outside the Editor

Once caches are purged (both WordPress page cache and Cloudflare cache, if applicable), test the exact old URL from the command line or a private browser window. curl gives you an unfiltered look at the status code and Location header without browser cache interference:

curl -s -o /dev/null -w "%{http_code} -> %{redirect_url}\n" https://example.com/old-slug/

You want to see 301 -> https://example.com/new-slug/ on the first hop, and 200 when following with curl -IL. Test both with and without a trailing slash, and test with a dummy query string like ?utm_source=newsletter to confirm your redirect rule preserves or cleanly handles parameters rather than dropping visitors on a 404.

Watching 404 Logs Without Over-Redirecting

For the first two weeks after the change, check your 404 logs, Cloudflare analytics, or Google Search Console coverage reports. You are looking for genuine missed paths—an old PDF URL, a forgotten /amp/ variant, or an old campaign link—not an excuse to redirect every random scanner hit.

Bots constantly probe WordPress sites for /wp-login.php, .env, or nonexistent zip files. Leave those as 404 or 403. Only add redirects for real human paths that used to exist, and fix any broken internal links at their source rather than papering over them with redirect rules.

Sources