How to migrate from WordPress to Next.js without losing Google rankings
I built many WordPress sites and I know their weak points from the inside: plugins that break with an update, licenses that renew every year and an endless stream of security patches. That is why I build in code with Next.js today. But the most common doubt before migrating is a different one: will I lose what I already earned on Google?
Nobody can guarantee exact positions. What you can do is prepare the migration so Google understands that the site changed its technology, not its content.
Before any code: audit and URL map
The first step is auditing the current site: which pages exist, what each plugin does and which pages already get traffic. Those last ones are the ones you cannot break.
With that list you build the URL map: which old address points to which new one. The rule is to keep URLs wherever possible. If a page changes address, you define where it must redirect. No URL with traffic should end up as a 404 error.
During the build: content and technical SEO
The content is migrated in full: text, titles, images with their alt text and the meta descriptions that already work. Rewriting all the copy at the same time as changing the technology makes it harder to tell what affected your rankings.
Technical SEO is there from day one: per-page metadata, JSON-LD structured data, a sitemap and, if the site has several languages, hreflang versions. A server-rendered Next.js site gives Google the full HTML and does not depend on a theme or a page builder.
So your team can keep editing without touching code, you add a simple admin panel or a CMS.
Launch: 301 redirects and Search Console
The new site goes live with the 301 redirects active from the first moment. A 301 redirect tells Google the page has moved permanently, so the new address takes over the place of the old one.
Then comes Search Console: you submit the new sitemap, watch for crawl errors and fix any URL that was left out of the map. The first weeks matter most.
At the end I hand over the code in a Git repository that belongs to you, with its change history, and a guide to editing your content.
A real case: Cube Media
The Cube Media website, built for an audiovisual production company, shows what the destination of a migration looks like. It is built directly in code with Next.js instead of WordPress. The team edits texts and portfolio projects in Sanity CMS, without touching code or depending on plugins, and the site has Spanish and English routes.
It includes a validated contact form that sends email through Resend, page transitions with the View Transitions API and animations with GSAP. It is the kind of site that replaces a plugin-heavy WordPress install: the content stays editable and the code stays versioned.
Do you have a similar case?
Tell me how you work today and what you want to solve. Native Spanish; English (B2).