Skip to content

WordPress to Next.js Redirect Generator

Moving a WordPress site to Next.js? Paste your old URLs or the WordPress sitemap and get a redirect map for next.config.js, vercel.json or Netlify, so old links and Google rankings keep pointing at the right pages.

1. Old URLs

The post sitemap (post-sitemap.xml or wp-sitemap-posts-post-1.xml), or one URL per line.

Pages, categories, tags… the other sitemaps, a crawl or a Search Console export.

2. The new site

Only if the new site has a feed, for example /rss.xml.

Dates in post addresses (/2023/05/post/) are dropped, page numbers (/page/2/) go to the first page, and trailing slashes are handled by the platform.

How to use it

Using the wordpress to next.js redirect generator

  1. Paste your old URLs: the WordPress sitemaps, a crawl or a Search Console export (one URL per line works too).

  2. Set where posts, categories and tags live on the new site, then check or edit each new address in the table.

  3. Copy the redirects for your platform — Next.js, Vercel or Netlify — or the CSV to review with your team.

Why redirects matter in a migration

Search engines rank pages by their address. When a WordPress post at /2023/05/my-post/ becomes /blog/my-post on the new site, the old address returns a 404 unless it redirects, and the rankings, backlinks and bookmarks pointing at it are lost.

A permanent redirect (301 or 308) for every changed address tells Google the page has moved, and sends visitors and the old address’s ranking signals to the new one.

Where to get the old URLs

The WordPress sitemap lists posts, pages, categories and tags: /sitemap_index.xml with Yoast or Rank Math, or /wp-sitemap.xml without a plugin. Open the post sitemap and the others, and paste their XML straight in — the tool picks out the URLs.

Add the pages from Search Console’s Pages report or a crawl too, so addresses that earn traffic or links aren’t missed, and do it before the old site is switched off.

Trailing slashes

WordPress addresses end in a slash; Next.js addresses don’t, by default. Next.js redirects /page/ to /page on its own, and Netlify matches a rule with or without the slash, so the map only needs the addresses that really change.

FAQ

Questions, Answered

301 or 308: which redirect should I use?

Both are permanent, and Google treats them the same way. Next.js and Vercel send 308 when a redirect is permanent: true; the Netlify rules here use 301. Either keeps your rankings.

Does it handle date, category and tag addresses?

Yes. Date-based post addresses (/2023/05/my-post/) go to the new post address, category and tag archives go where you set them, page numbers (/page/2/) go to the first page, and author pages and feeds go where you choose. You can edit any row.

What if my site has thousands of URLs?

The generator handles long lists, but thousands of rules in next.config.js make builds slower. For very large sites, load the map from a JSON file in middleware instead, or replace groups of rules with one pattern (for example, every /2023/05/slug to /blog/slug).

What about images in wp-content/uploads?

Uploaded files aren’t pages, so they’re skipped. If the new site keeps images somewhere else, add one rule for the whole folder, such as /wp-content/uploads/* to the new location, or keep the old files where they are.

Is anything uploaded?

No. The map is made in your browser; nothing you paste is uploaded or stored.

Planning a WordPress to Next.js migration?

I move WordPress sites to Next.js and Sanity CMS with their content, URLs and SEO intact, redirects included. Tell me about your site.

Email me