Skip to content
bellona

Guide

Migrate from WordPress to Next.js without losing SEO

Moving a site from WordPress to Next.js changes how every page is built, but it should not change what Google already knows about you. The risk is losing addresses, titles and links; the work is mapping every old page to a new one before launch and proving afterwards that nothing was lost.

By: Sina Razi, Co-founderLast updated:

Why migrate from WordPress to Next.js, and when not to?

People move for speed, security and control: a custom Next.js site loads only what it needs, has less third-party code to patch and gives full control of structure and SEO. Do not move if your team edits layout daily without a developer and you have no budget for engineering.

WordPress is a good choice when non-technical staff need to rebuild pages themselves, when the budget is small, or when the site is simple. The costs show up later: plugins that need constant updating, themes that limit design, and pages that are slower than they need to be.

Next.js builds pages on the server, so the complete text arrives in the first response, which search engines and AI assistants read easily. Content editing does not have to disappear: a headless CMS such as Payload sits behind Next.js and gives the newsroom or marketing team an editor.

What should you inventory before you start?

Everything that Google or visitors already depend on: every URL, every content type, categories and tags, authors, images and files, forms, titles and meta descriptions, redirects that already exist, and the pages that bring the most traffic. The inventory is the contract the new site has to honour.

  1. Export all URLs from the sitemap and from a crawl
  2. List content types: posts, pages, custom post types
  3. List the taxonomy: categories, tags, authors
  4. Export media and note where images are used
  5. Record titles, descriptions and canonical tags of the main pages
  6. Note forms, integrations and tracking that must keep working
  7. Find the pages with the most traffic and links from Search Console

What is the full migration checklist?

Ten steps: inventory, URL map, new structure, content migration, taxonomy clean-up, 301 redirects, titles and metadata, a staging review, launch, and monitoring. Each step has an owner and a test, and nothing launches until the redirect map has been tested against the real list of old URLs.

  1. Inventory every URL, content type and taxonomy
  2. Build the URL map: old address to new address
  3. Design the new structure and templates
  4. Migrate content with its tags, authors and media
  5. Clean up the taxonomy before it is carried over
  6. Write a permanent (301) redirect for every old URL
  7. Carry titles, descriptions and structured data across
  8. Review on a staging site that is blocked from search engines
  9. Launch, then submit the new sitemap in Search Console
  10. Monitor 404 errors, indexing and traffic for the first weeks

How do you map URLs and write 301 redirects?

Every old URL gets exactly one destination: the equivalent page, or the closest relevant page if there is none. Use permanent 301 redirects, one hop only, never to the home page by default. In Next.js they live in next.config, generated from your URL map so none is forgotten.

Example of a URL map
Old WordPress URLNew URLRedirect
/2023/05/example-post//articles/example-post301
/category/science//topics/science301
/author/jane//authors/jane301
/?p=1234/articles/example-post301 (from the post ID)
// next.config.ts: redirects generated from the URL map
import type { NextConfig } from "next";
import { urlMap } from "./redirects";

const config: NextConfig = {
  async redirects() {
    return urlMap.map(([from, to]) => ({ source: from, destination: to, permanent: true }));
  },
};

export default config;

How do you migrate posts, tags, authors and media?

Export from WordPress, transform to the new content model and import in one repeatable script, so the migration can be re-run until it is right.

A repeatable script matters more than the first run. Content is never clean: posts have missing images, broken internal links and inconsistent categories. Running the migration repeatedly against a staging database lets you fix those in the script instead of by hand.

Why clean up the taxonomy before migrating?

A sprawling taxonomy carried over unchanged becomes a sprawling taxonomy in the new site. Consolidating categories and tags before the move is easier for readers and for search engines to understand.

When categories and tags are merged, their old archive pages need redirects too. Decide for every old category and tag where it goes (a new category, a topic, or the most relevant article list) as part of the URL map, not after launch.

What must stay the same: titles, descriptions and structured data?

Keep the title and meta description of pages that already rank unless you have a reason to change them, keep one canonical address per page, and carry structured data across. Changing a ranking page's title and URL in the same release makes it hard to tell what caused any drop.

  1. Reuse titles and descriptions of pages that already bring traffic
  2. One canonical URL per page, matching the new address
  3. Re-create structured data (Article, Breadcrumb, Organization)
  4. Keep heading structure and the main text of key pages
  5. Preserve image alt text and file names where possible

What do you do with the sitemap and Search Console?

Generate a new sitemap that lists only the final URLs, with true last-modified dates, and submit it in Search Console the day you launch. Keep the old property, watch the Pages report for errors, and use URL inspection on the most important pages to confirm Google sees the redirects.

// app/sitemap.ts
import type { MetadataRoute } from "next";
import { getAllArticles } from "@/lib/content";

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
  const articles = await getAllArticles();
  return articles.map((a) => ({
    url: `https://example.com/articles/${a.slug}`,
    lastModified: a.updatedAt, // the real update date, never the build time
  }));
}

What should you check on launch day and in the first month?

On launch day, test every old URL against the redirect map, check that the site is no longer blocked from search engines, and submit the sitemap. For the first weeks, watch 404 errors, the number of indexed pages, impressions and clicks, and fix gaps in the redirect map immediately.

  1. Crawl the old URL list and confirm each one returns a single 301 to a 200 page
  2. Remove any noindex or robots block left from staging
  3. Submit the new sitemap
  4. Check Search Console: coverage, 404s and impressions daily at first
  5. Fix every missing redirect and re-test

Which mistakes do migrations most often make?

Redirecting everything to the home page, chains of two or more redirects, temporary (302) instead of permanent redirects, forgetting images and files, leaving staging blocked from search engines, and changing every URL and title at once. Each is avoidable with the URL map and a test crawl.

  1. Mass-redirecting old URLs to the home page
  2. Redirect chains instead of a single hop
  3. 302 redirects where 301 was intended
  4. Missing redirects for images, PDFs and archive pages
  5. A staging noindex or robots block left on after launch
  6. Changing URLs, titles and content all in one release

How can Bellona help with a migration?

We start with the free growth audit: we read your current site, URLs and risks, and give you a fixed quote in writing for the migration. The site stays online throughout, and monitoring after launch is part of the work.

LET'S TALK

Ready when
you are.

Tell us where it hurts. You get a free 30-minute growth audit and, if it fits, a fixed quote.

Prefer to pick a time?

Book a free growth audit

Or email bellona.ai.team@gmail.com

What do you need?

We only use this to reply to you.