How to change permalinks in WordPress without losing SEO
You can change WordPress permalinks without losing SEO if every old URL returns a 301 redirect to its new address in a single hop, your internal links and sitemap switch to the new URLs, and you watch Search Console for a few weeks afterwards. For one post's slug, Hydrogen SEO's Auto Redirection adds the 301 for you. For a site-wide structure change, you need a pattern rule or a full redirect map.
Rankings usually settle within a few weeks when the redirects are right. When they are missing, old URLs turn into 404s and the links pointing at them stop counting.
Step by step
1. Save a list of your current URLs
Before touching anything, record what exists. Open your sitemap and save each child sitemap, or export the top pages from Search Console's Performance report. This list is how you test the redirects later, and it is impossible to rebuild once the old URLs are gone.
2. Decide whether the change is worth it
Good reasons: dates in URLs on evergreen content, ?p=123 plain permalinks, or slugs that no longer describe the page. Weak reasons: shaving one word off a slug that already ranks well. Every change costs a redirect you keep forever and a few weeks of reprocessing. If you are only fixing a slug, write the new one with the URL slug generator and keep it short, lowercase and hyphenated.
3. Change a single slug with Auto Redirection on
- Open Hydrogen SEO → Redirections and switch on Auto Redirection at the top.
- Edit the post, change its slug, and update it.
- Back in Redirections, a new 301 rule tagged Auto points from the old address to the new one.
WordPress core also remembers old post slugs and often redirects them, but it does not cover every case, so an explicit rule you can see is safer.
4. Change the permalink structure
Under Settings → Permalinks, pick the new structure, for example Post name (/%postname%/) instead of Day and name, and click Save Changes. Every post URL changes at once, so add a pattern redirect at the server. For Apache, place this above the # BEGIN WordPress block in .htaccess:
RedirectMatch 301 ^/[0-9]{4}/[0-9]{2}/[0-9]{2}/([^/]+)/?$ /$1/
On Nginx, the equivalent goes in the server block:
rewrite ^/[0-9]{4}/[0-9]{2}/[0-9]{2}/([^/]+)/?$ /$1/ permanent;
Adjust the pattern to your old structure (drop one [0-9]{2}/ for Month and name). Hydrogen SEO's rules match on exact paths or on Contains, Starts With and Ends With, which is ideal for individual URLs but not for rewriting a pattern like this. Use it for exceptions the pattern misses.
5. Test the old URLs
Take a sample from the list you saved and request each one:
curl -sIL https://example.com/2024/05/12/old-post/ | grep -iE "^(HTTP|location)"
You want exactly one 301 followed by a 200. Two or more redirects in a row is a chain; fix it with how to fix redirect chains.
6. Update internal links
Links inside post content are stored as full URLs, so they still point at the old addresses and now go through a redirect. For a fixed prefix you can use a search-and-replace tool; with WP-CLI, always preview first:
wp search-replace 'https://example.com/old-section/' 'https://example.com/new-section/' --dry-run
Menus built from pages and posts update themselves. Custom links in menus do not.
7. Check the sitemap, canonicals and Search Console
Reload your sitemap in a private window and confirm it lists the new URLs; Hydrogen SEO rebuilds it when content changes, but purge any CDN copy. View source on a post and check rel="canonical" shows the new address. Over the next weeks, the old URLs will appear in Search Console under Page with redirect. That is expected and means Google saw the move.
Common mistakes
- Redirecting every old URL to the homepage. Google treats that as a soft 404 and the rankings do not transfer. Map each URL to its own new address.
- Changing structure twice. A second change turns the first set of redirects into chains unless you update them to the final URLs.
- Removing redirects after a few months. Keep them as long as anything links to the old URLs, which for most sites means indefinitely.
- Changing the category base at the same time without checking the result. If you plan to remove
/category/, do it as its own step with remove the category base.
When not to do this
Do not restructure a large, established site just before a busy season, or at the same time as a domain move or redesign. If something goes wrong, you will not know which change caused it. Make one change, confirm it in Search Console, then make the next.
Common questions
Will changing permalinks hurt my rankings?
Expect some movement while Google processes the redirects, usually for a few weeks. With single-hop 301s to matching pages, rankings normally recover to where they were.
Does WordPress redirect old slugs automatically?
Core often redirects a changed post slug, but not every case and not structure changes. Hydrogen SEO's Auto Redirection adds a visible 301 rule for each slug change on posts, pages and terms.
How long should I keep the redirects?
As long as the old URLs have backlinks or traffic. Rules cost almost nothing to keep, so most sites never remove them.