How to Fix WordPress Migration Issues (SEO, Redirects, Database)
WordPress migrations (host change, domain change, URL structure change, HTTP→HTTPS) almost always cause SEO regressions if not managed carefully. This guide covers the WordPress migration SEO workflow: pre-migration audit, redirect mapping, database search-replace, sitemap regeneration, schema cleanup and post-migration validation. Pair with migration audit guide.
Step 1: Pre-migration audit
Crawl with Screaming Frog. Record all URLs, titles, meta descriptions, internal links. Export Search Console data: queries, clicks, impressions. This is your baseline.
Step 2: Plan redirect mapping
Old URL → New URL. For domain changes, every URL needs a redirect. For structure changes (permalinks edit), every old URL must redirect to new equivalent. Spreadsheet: old_url, new_url, status (301), test result.
Step 3: Run database search-replace
After migration, hardcoded URLs in post content reference the OLD domain. Use WP-CLI: 'wp search-replace olddomain.com newdomain.com'. Or Better Search Replace plugin. CRITICAL: must handle serialised data correctly — WP-CLI does this, naive SQL doesn't.
Step 4: Configure 301 redirects
Install Redirection plugin. Import your redirect mapping. Test each redirect resolves to 200 (not 301→404 chains). For .htaccess-level redirects (faster), add to .htaccess directly: 'Redirect 301 /old-url /new-url'.
Step 5: Regenerate sitemap and resubmit
Yoast/Rank Math/AIOSEO auto-regenerate sitemap. Visit /sitemap_index.xml to confirm. Resubmit in Search Console (Sitemaps → Add new). Use both old and new sitemap URLs if you've redirected the sitemap location.
Step 6: Update schema canonical and Organization
Schema's canonical and Organization.url should reflect new domain. If managed by SEO plugin, plugin updates automatically once you change Settings → General URLs. Custom schemas in theme code need manual update.
Step 7: Post-migration validation and monitoring
Within 24h: crawl new site, verify no 404s in critical pages. Within 7 days: Search Console new property submitted, change-of-address tool used (if domain change), redirects resolved correctly. Within 30 days: organic traffic should approach baseline. If down by more than 20% after 30 days, deeper audit needed.
Frequently Asked Questions
How long does WordPress migration SEO recovery take?
Typical pattern: 7-14 days of temporary traffic dip (often 20-40% drop) as Google re-crawls and updates index. By day 30, most well-executed migrations recover to baseline. By day 60, often higher than pre-migration if migration improved speed/structure. If still down after 60 days, technical migration issues likely.
Should I use plugins for migration or manual SQL?
Plugins for most cases: Duplicator, All-in-One WP Migration, WP Migrate. Manual SQL only if you're moving between very different server configurations or fixing a botched migration. Always run WP-CLI search-replace after import — naive SQL search-replace breaks serialised PHP data in wp_options and other tables.
Do I need to change the domain in Search Console too?
Yes for domain changes — use Search Console's Change of Address tool. Property the new domain, verify it, then in old property use Settings → Change of Address → point at new. Speeds up Google's recognition of the move.
What about HTTPS migration specifically?
Treat HTTP→HTTPS as a domain change. Every http:// URL must 301 to https://. Update Search Console (add HTTPS property, change of address from HTTP). Update Google Analytics property URL. Update social media profiles. Update third-party citations and backlinks where you can (high-value ones).
Why did my WordPress site lose rankings after a permalink structure change?
Permalink changes break every existing URL unless redirects are in place. If you changed from /?p=123 to /sample-post/, every old URL is now 404 unless redirected. Fix: regenerate the redirect map immediately, point old patterns at new ones via Redirection plugin or .htaccess rules.
🔄 Audit WordPress migration
Find broken redirects, hardcoded URLs and migration gaps.
Run Migration Audit →