SquishPixel Blog · SEO · WordPress · Hosting and CDNs

How to migrate a WordPress site without losing search rankings

According to DEV Community, a migration guide by a WordPress developer argues that traffic loss usually starts weeks before launch, when nobody records which URLs exist. The author's rule is that each old URL either lands somewhere sensible or is a deliberate 404. The examples come from the author's own move from WordPress to Next.js.

The guide says rankings fall when a URL loses its history, such as links from other sites. Common causes are URLs that change with no redirect, changing everything at once, staging settings that go live, and sending every old page to the home page. It cites Google's warning that this last habit "might be treated as a soft 404".

Before the move, the author advises listing every URL from several sources: Search Console's indexed and not-indexed pages, its top linked pages, and a crawl of the live site. Do not forget URLs WordPress creates itself, such as category and tag archives, author pages, feeds and paginated archives. Then export three months of Search Console performance data as a baseline, and map each old URL to a new one in a spreadsheet. Keep titles and content the same during the move, and redesign afterwards.

For the move itself, the guide suggests comparing counts of posts, pages, media, users and comments before and after. If the domain changes, use WP-CLI rather than a raw SQL find-and-replace, because WordPress stores some settings in a form plain text replacement can corrupt. Use one-hop 301 or 308 redirects and keep them for "generally at least 1 year", per Google's site-move guide.

On launch day, unblock search engines, check robots.txt, test the redirects, update internal links and canonical tags, and submit the new sitemap. The Change of Address tool is only for a new domain or subdomain. Afterwards, watch the Search Console 404 report. The author found four missed 404s on his own site. Google says a medium-sized site may need "a few weeks or more" to settle.

Why it matters

Most of the work in this guide happens before launch. A site owner who skips the URL inventory has no way to know which old pages still earn links or traffic, and a missed redirect quietly sends visitors and search engines to an error page.

The advice also helps in less dramatic cases. Leaving a staging block switched on, redirecting everything to the home page, or changing design and content together can each hide the cause of a drop. Keeping changes small and recording a baseline makes problems easier to trace.

Source: DEV Community. This brief summarises their reporting; read the original for the full detail.