// blog / migrations

How I change WordPress permalinks without breaking rankings

Most of the time I don't change WordPress permalinks that already rank, because every changed URL has to be redirected and its place re-earned. When a change is worth it, like dropping dates from post URLs, I export every old URL, map each one to its new address with a 301, and test the map on staging first.

By Muhammad Younus Updated 10 min read Migrations

Migrations and redesigns, SEO side: illustration for "Changing WordPress permalinks safely"
// 02 - new sites

What is the best permalink structure for WordPress?

Post name, which WordPress writes as /%postname%/. I set it on day one, before a single post or page is published, because a structure that never changes never needs an old address mapped to a new one.

A fresh install often doesn't start there. The documentation says the default is Plain and calls it not user-friendly and not optimized for search engines, though since 4.2 the installer tries pretty permalinks first and falls back to Plain only when they don't work. Google's URL guidance points the same way: readable words rather than long ID numbers, hyphens rather than underscores, and one consistent case, because Google treats /APPLE and /apple as two distinct URLs.

The six choices on Settings, Permalinks, and what I think of each
SettingWhat the URL carriesMy view on a new site
Plain?p= and the post's database IDNever. It's the first thing I change
Day and name/%year%/%monthnum%/%day%/%postname%/Only for a news site where the date is the point
Month and name/%year%/%monthnum%/%postname%/Same problem, one level shorter
NumericThe post's ID from the databaseNo. A number tells a searcher nothing
Post name/%postname%/My default for almost every site
Custom structureAny mix of structure tagsOnly when there's a real reason, like keeping an old platform's pattern

Two more settings sit on the same screen. The category base and tag base are the prefixes in archive URLs, /category/ and /tag/ by default; WordPress lets you rename them but not remove them. WooCommerce's product base puts /product/ in front of product URLs, or the shop page's name with Shop base. I pick these once, before launch, because changing any of them later moves every URL that carries it.

// 03 - the decision

When is changing an existing structure worth the risk?

Less often than people think. A structure that's ugly and ranks is worth more than one that's pretty and has to earn its place again, so I ask one question: does the old pattern cost more, every month, than a redirect costs once? If it doesn't, I leave it.

My call on the permalink changes owners ask for
The situationMy callWhy
Still on Plain ?p=123 URLsChange it, with a 301 mapThe URLs say nothing, and WordPress's own docs call them not optimized for search
Dates in the URLs of posts that get updatedUsually change itA 2019 in the address of a post rewritten this year looks stale in the results, whatever the page says
%category% in the structure, posts in several categoriesWorth a lookOnly one category can show, the one with the lowest ID in the code, and moving a post between categories moves its URL
A misspelled or clumsy slug on a page that ranksLeave itThe spelling isn't what's holding it back, and the redirect puts the ranking at risk

If the change is part of a bigger redesign, the build is your developer's job. What I own is the search side: the URL list, the map and the checks either side of launch.

Rather have me do this? One person, whole job.

Book a call on Upwork
// 04 - the risk

Does changing a URL affect SEO?

Yes. Google ranks addresses, so a new URL starts as a new page until Google follows a redirect from the old one. Every link from another site, every bookmark and every internal link still points at the old address, and without a 301 each of them hits a 404.

With a 301, the history moves, but not instantly. Google's guidance on moves with URL changes says rankings may fluctuate while it recrawls and reindexes, and that a medium-sized site can take a few weeks or more before the new URLs show in place of the old ones. So I won't tell anyone a change will be invisible, and I won't give a date for things to settle.

The same page sets the rules I work to: server-side permanent redirects, kept for at least a year, and never a pile of old URLs pointed at one irrelevant page like the homepage, which Google says might be treated as a soft 404.

// 05 - the method

How I change WordPress permalinks safely, step by step

Saving the Permalinks screen takes one click. All the care goes into what happens before and after it.

  1. Step 01

    Write down the new pattern first

    The exact structure tags, whether any category, tag or product base changes, and what happens to pages, which don't use the post structure at all.

  2. Step 02

    Export every URL that exists now

    The XML sitemap, a full crawl, the Search Console Performance report by page and a backlink export, which finds old addresses other sites still send people to.

  3. Step 03

    Map every old URL to exactly one new URL

    Going from Day and name to Post name, /2019/05/12/slug/ becomes /slug/. I still keep the full list, because the leftovers, like a slug edited since, are where redirects go wrong.

  4. Step 04

    Write the rule as a server-side 301

    In the server config or a redirect plugin that sends a real 301 status, written the way the next section shows. I check the response code itself, not the browser.

  5. Step 05

    Rehearse it on a staging copy

    Same content, same plugins. I change the setting there, save it, switch the redirects on and leave the live site untouched until the test passes.

  6. Step 06

    Test the whole list over HTTP

    Every old URL should answer with one 301 and land on a page that returns 200. Chains, loops, 404s and anything that lands on the homepage get fixed before I go further.

  7. Step 07

    Change the live setting and the redirects together

    Both go live in the same few minutes, never a day apart, then I run the full list again against the live domain within the hour.

  8. Step 08

    Update everything that still names the old URLs

    Menus, links inside posts, canonicals and the XML sitemap. Google's move guidance names two of these outright: point internal links at the new URLs, and submit the new sitemap in Search Console.

// watch out

Don't change the setting on the live site to see what happens. The old URLs start failing the moment you save, and if you change it back, anything Google crawled in between has already seen the 404s.

// 06 - the redirects

How do I set up the redirects for a permalink change?

With one pattern rule for the structure, and one-off rules above it for the leftovers. These are the three ways I write the Day and name to Post name rule, depending on what the site runs on.

  1. i.

    The Redirection plugin

    It has full support for regular expressions. The source is ^/\d{4}/\d{2}/\d{2}/(.+)$ with Regex ticked, and the target is /$1, where the captured slug fills in $1.

  2. ii.

    Apache, in .htaccess

    Outside WordPress's own # BEGIN WordPress block, so saving permalinks doesn't overwrite it: RedirectMatch 301 ^/\d{4}/\d{2}/\d{2}/(.+)$ https://example.com/$1

  3. iii.

    Nginx, in the server block

    rewrite "^/\d{4}/\d{2}/\d{2}/(?<slug>.+)$" /$slug permanent; The quotes matter, because Nginx needs them round a pattern with curly braces, and permanent sends a 301.

A redirect mapping sheet for a Day and name to Post name change
Old URLNew URLHow it's handled
/2019/05/12/fix-a-slow-store//fix-a-slow-store/The pattern rule
/2021/03/02/old-slug/, renamed since/current-slug/A one-off rule placed above the pattern
/about/, a page/about/No rule: pages don't use the post structure
/category/news//category/news/No rule, unless the category base changed too
// 08 - what wordpress does

Doesn't WordPress redirect the old URLs on its own?

Partly, for one narrow case. When you edit a single post's slug, WordPress keeps the old slug on record, and its code reference describes a function that redirects a request for that old slug to the current permalink when it would otherwise be a 404.

The same reference says it skips hierarchical post types, and pages are hierarchical, so a renamed page gets no help. And it's about slugs, not structures, so I don't rely on WordPress guessing its way from one pattern to another. I write the rule myself and test it.

After launch I watch the Pages report in Search Console. Old URLs moving to Page with redirect is the healthy sign, and new URLs that sit unindexed for weeks have a diagnosis of their own. If Search Console reports that Google chose a different canonical than the one you set, the old and new URLs are both still answering with a 200, which is two copies of every post and the kind of problem the duplicate content service untangles.

// 09 - the proof

Why did I leave a misspelled URL alone?

Because it ranks. On a WooCommerce jewellery store where I mapped the redirects after a redesign, the turquoise category lives at /tourquoiseferoza/. It pairs the English and Urdu names for the stone, the way Pakistani buyers search, and the English half is spelled wrong.

It's also a misspelled category URL that still ranks at 4.3 on 51,693 impressions between 13 June and 11 September 2026, the window the case study covers. Correcting it would change a URL that ranks, and that's the mistake the store's traffic drop started with: a redesign renamed its addresses without a redirect map. I wasn't going to repeat it for one letter.

// when to hand this over

If you're weighing a permalink change and want one person to make the call, build the map and test it before anything goes live, that's the URL change work I do, remotely, from the first export to the Search Console checks after.

Book a call on Upwork

Is this your site? Send me the URL.

Book a call on Upwork
// questions - migrations

What else do people ask about this?

Is a permalink just a URL?

Yes. It's the URL WordPress gives a post, page or archive, and the perma part says it's meant to stay put. The structure behind it is set once under Settings, Permalinks.

Can I change my permalink structure after the site is live?

Yes, but only with a 301 from every old URL to its new one, switched on at the same time as the new setting and tested on staging first. The old URLs start failing the moment the setting's saved.

Should I fix a typo in a URL that already ranks?

I don't. The typo isn't what's holding the page back, and the redirect puts a working ranking through a move for no measurable gain.

How long should permalink redirects stay in place?

At least a year, the floor Google's site move guidance sets. Where other sites still link to an old permalink, I don't take its redirect down at all, because removing it turns each of those links into a 404.

// sources - checked

Where do these rules come from?

Platform and Google documentation, opened and read on the day this was written. Everything else is how I work.

  1. WordPress.org documentation: customize permalinks
  2. Google Search Central: URL structure best practices
  3. Google Search Central: site moves with URL changes
  4. WordPress code reference: wp_old_slug_redirect()
  5. WordPress code reference: wp_install_maybe_enable_pretty_permalinks()
  6. WooCommerce documentation: permalinks
  7. WordPress Advanced Administration: Apache HTTPD and .htaccess
  8. WordPress Advanced Administration: Nginx
  9. WordPress.org: Redirection plugin
  10. Apache HTTP Server 2.4: mod_alias, RedirectMatch
  11. nginx documentation: ngx_http_rewrite_module
  12. WordPress code reference: insert_with_markers()
Muhammad Younus, WordPress technical SEO consultant
// who wrote this

One consultant, writing down his own method

I'm Muhammad Younus, a WordPress technical SEO consultant with 8+ years of experience and 100+ client sites fixed. Top Rated Plus on Upwork with a 100% Job Success Score. Every post here is the way I actually do the job, written in the first person because it's one person doing it, remotely, with no team behind the name.

Nothing in these posts is a client I can't name or a number I can't show. Where a figure comes from a client's Search Console, it's from a published case study, and where a rule comes from Google or a platform, the source is linked at the bottom of the post.

// the service behind this post
Muhammad Younus with a friendly open smile, head tilted slightly
// next step

Want this done on your own site?

Book a call on Upwork, send the URL and read-only Search Console access, and you'll get a written scope for the search side before any work starts. One person does the whole job, remotely.

Book a call on Upwork