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.
Using the wordpress to next.js redirect generator
Paste your old URLs: the WordPress sitemaps, a crawl or a Search Console export (one URL per line works too).
Set where posts, categories and tags live on the new site, then check or edit each new address in the table.
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.
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.
More free tools
- HTML Email CheckerPaste an HTML email or signature and get a list of what may break in Outlook, Gmail and other email apps, with the fix for each.
- Email Signature Size CheckerFix Gmail’s “Signature is too long” error: check your signature against the 10,000-character limit and get a shorter copy.
- Gmail Clipping CheckerSee your HTML email’s size against Gmail’s 102 KB limit, what makes it heavy, and get a smaller, minified copy.
- CSS Inliner for EmailMove the CSS from your <style> block into inline styles, keeping media queries, with Outlook width attributes added.
- Bulletproof Button GeneratorDesign an email call-to-action button and copy HTML and VML code that works in Outlook, Gmail and Apple Mail, with no images.
- Outlook Background Image GeneratorBackground images that show in classic Outlook too: copy HTML and VML code with your image, size and fallback colour.
- Email Template & Signature EditorEdit an HTML email template or signature without touching the code.
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.