Migrating From WordPress to Next.js Without Losing Your Rankings
Moving a site from WordPress to Next.js can make it faster and easier to maintain, or wipe out years of search traffic overnight. Here is the migration process I use to keep rankings intact.

Every few weeks someone asks me to move their WordPress site to Next.js. Sometimes it is the right call: the site is slow, fragile, held together by plugins, and the business wants something faster and more bespoke. Sometimes it is not, and a well-built WordPress site with a sensible plugin audit would serve them better. Either way, the riskiest part of the project is not the new code. It is the moment the old URLs stop existing. Done carelessly, a migration can wipe out years of search traffic in a week. Done properly, rankings hold and often improve. This is the process I follow.
First, should you migrate at all?
Next.js is not automatically better than WordPress. I compared the two honestly in why Next.js beats WordPress on speed, and when it does not. Good reasons to migrate include:
- The site needs custom functionality that is fighting against WordPress and its plugins.
- Performance problems persist even after hosting, caching and plugin fixes.
- The business wants a fully custom front end and is happy to manage content in a different way.
- Security and maintenance overhead from a large plugin stack has become a real cost.
Weak reasons include "Next.js is modern" and "a developer told me WordPress is dead". If your team publishes content daily and loves the WordPress editor, a headless setup that keeps WordPress for editing may be the better middle ground. I cover that option in headless WordPress with Next.js: the honest trade-offs.
Step 1: Inventory every URL that matters
Before writing any code, build a complete list of the URLs on the current site. I combine four sources:
- The WordPress XML sitemap, which covers posts, pages and taxonomies.
- A crawl of the live site, which catches pages the sitemap missed.
- The Pages report in Google Search Console, which shows what Google has indexed.
- Search Console's Performance report and your analytics, which show which URLs actually earn clicks and traffic.
Do not forget category and tag archives, author pages, paginated archives, image attachment pages, PDFs in the uploads folder, and any old URLs that already redirect. Put everything in a spreadsheet with its traffic and backlinks. That spreadsheet becomes the migration plan.
Step 2: Decide the new URL structure, and keep it where you can
The safest migration is one where URLs do not change at all. Next.js gives you complete control over routing, so you can usually match the old structure exactly, including date-based post URLs if that is what you had. Every URL you keep is one less redirect and one less risk.
Where you do change URLs, perhaps to drop /category/ prefixes or tidy up messy slugs, do it deliberately and only where the benefit is clear. A redesign is a tempting moment to restructure everything. Resist restructuring for its own sake.
Step 3: Build the redirect map
For every old URL that changes or disappears, decide where it should go, and record it in the spreadsheet:
- Changed URL, same content: a permanent 301 redirect to the new URL.
- Merged content: a 301 to the page that now covers the topic.
- Removed with no replacement: a 410 or a 404, not a redirect to the homepage. Mass redirects to the homepage are treated as soft 404s and pass little value.
In Next.js, redirects can live in the config file, in a data file read at runtime, or in the proxy layer for large sets. Avoid redirect chains, where an old URL redirects to another old URL that redirects again. Point everything straight to its final destination.
Step 4: Carry the content and metadata across faithfully
Rankings are attached to content as well as URLs. When moving content:
- Keep the same title tags and meta descriptions, at least for launch. Improve them later, one change at a time.
- Keep heading structure, body copy, internal links and image alt text intact.
- Recreate structured data the WordPress SEO plugin was generating: Article, Organization, BreadcrumbList, and anything else that was there.
- Keep canonical tags pointing at the correct new URLs.
- Bring images across and keep their file names where practical.
- Update internal links in the content to the new URLs, so you are not relying on redirects for your own navigation.
My Next.js SEO guide covers how to set up metadata, sitemaps and structured data properly in the App Router.
Step 5: Test before launch
On the staging site, I check:
- Every URL in the spreadsheet returns the expected status: 200 for kept pages, 301 to the right place for moved ones, 410 or 404 for removed ones.
- Title, description, canonical and robots tags on a sample of every page type.
- The new XML sitemap lists only live, indexable URLs.
- robots.txt allows crawling on production. Staging should block it; production must not.
- Core Web Vitals in a lab test, so the new site is genuinely faster than the old one.
Step 6: Launch day and the weeks after
On launch day, I submit the new sitemap in Search Console, inspect a handful of key URLs, and run a crawl of the live site against the old URL list. Then the monitoring begins:
- Check the Pages report for spikes in "Not found (404)" or "Page with redirect" errors.
- Watch clicks and impressions in the Performance report, comparing against the same period before launch.
- Check server logs or analytics for 404 hits from old URLs you missed, and add redirects.
- Keep the redirects in place permanently. Removing them after a few months throws away the value they carry.
Some movement in the first two to four weeks is normal while Google recrawls. A sustained drop usually points to something specific: missing redirects, lost content, or changed titles. My Google Search Console guide explains where to look.
Frequently asked questions
Will I lose SEO rankings moving from WordPress to Next.js?
Not if the migration is planned properly. Rankings are lost through broken URLs, missing redirects and changed content, not through the change of framework. Keep URLs where possible, redirect the rest one to one, and carry content and metadata across intact.
Can I keep WordPress for editing content?
Yes. A headless setup uses WordPress as the content editor and Next.js as the front end. It suits teams that publish frequently and like the WordPress editor, at the cost of a more complex setup.
How long does a WordPress to Next.js migration take?
It depends on the size of the site and how much is being redesigned. A small brochure site can move in a couple of weeks; a large content site with custom functionality takes longer, mostly because of content and redirect work rather than code.
Do 301 redirects pass ranking value?
Yes. Google has confirmed that permanent redirects pass signals to the new URL. They should point directly to the final, relevant page and stay in place long term.
The bottom line
A framework migration is a content and URL project with some code attached. Inventory everything, keep what you can, redirect what you must, test before launch and watch closely after. Do that, and the speed and flexibility of Next.js arrive without the traffic cliff.
Thinking about moving your WordPress site to Next.js? Tell me about your current site and I will give you an honest view on whether it is worth it, and a migration plan that protects your rankings if it is.




