WordPress
WordPress migration lost pages: fix redirects
Separate WordPress old-slug redirects from a full migration map, then restore the missing server redirects without changing every URL again.
WordPress "wp_old_slug_redirect" only handles old slugs for published non-hierarchical posts, so Pages, permalink changes, and migrated domains or paths can remain broken. Record the current permalink structure, map the missing old URLs, add permanent redirects at the web server, and test each old address without changing the URL structure again.
Why WordPress does this
WordPress has limited automatic old-slug handling, not a migration map. Core stores an old slug only for published, non-hierarchical post objects, then wp_old_slug_redirect attempts a permanent redirect when that old slug returns 404. The function explicitly skips hierarchical post types, which includes normal Pages. It also does not solve a global change under Settings > Permalinks, where "Day and name", "Month and name", "Post name", "Custom Structure", "Category base", or "Tag base" can change many URL shapes at once. WordPress documents custom migration redirects in the web server configuration, including .htaccess on Apache.
Check it right now
Before changing anything, confirm what a crawler actually sees. The check is free, takes one URL and needs no account.
How to fix it
- Run the redirect checker on a missing old URL. Record its status and destination before changing WordPress settings.
- Open Settings > Permalinks and record the selected structure plus "Category base" and "Tag base". Do not switch structures again to repair individual old URLs.
- For one renamed post, test whether WordPress core already redirects the stored old slug. Do not assume the same behavior for Pages or a site-wide permalink change.
- Build an old-to-new URL map for everything still returning 404. Add permanent server-side redirects to the matching new pages. On Apache, preserve them in .htaccess.
- If the migration changed the domain or install path, verify "WordPress Address (URL)" and "Site Address (URL)" under Settings > General.
- Test every old URL in the redirect checker. Each should go directly to its equivalent new URL, without a chain or a blanket jump to the home page.
Why it happens again
The WordPress migration guide warns that regenerating .htaccess for permalinks can remove custom rewrites and redirects. Back up the file, then check that the custom rules are still present after saving Permalinks or moving the site.
stillindexed re-checks the URLs you give it every 30 minutes on Starter and alerts when a directive changes, at most 30 minutes after it does. It is a monitor rather than a crawler: it watches a list you choose and tells you when one of seven things changes. Card first, no trial, and a 30 day refund.
Catching it next time
Fixing it once is the easy half. The setting that caused this can be changed again by anyone with access, and the page will keep returning 200 while it happens.
Other ways WordPress loses pages
- my WordPress staging site is indexed by Google
- Every page on the site vanished from Google, and the last thing anyone touched was the WordPress dashboard.
- my WordPress robots.txt is blocking pages that should be crawled
- A WordPress page's canonical tag points at the wrong URL, usually because two SEO plugins, a theme or a code filter disagree about who writes it.
- The http, www or non-www version of a WordPress site takes an extra hop before reaching the final URL, because the host and WordPress each redirect once.
A migration or redesign losing pages from search, on other platforms
Sources
Every claim about WordPress above is from their own documentation, read on 2026-08-30. Platforms change their settings; if one of these is out of date, their page wins and we would like to know.
- https://developer.wordpress.org/reference/functions/wp_check_for_changed_slugs/
- https://developer.wordpress.org/reference/functions/wp_old_slug_redirect/
- https://wordpress.org/documentation/article/settings-permalinks-screen/
- https://developer.wordpress.org/advanced-administration/upgrade/migrating/
- https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes