For WordPress to Next.js migrations

Build the redirect map for your WordPress to Next.js move

The Redirect Map Builder turns a list of old WordPress URLs, or old and new pairs, into permanent redirects for Next.js: a redirects() array to paste into next.config.js. It flags chains, loops, duplicates, trailing slashes, query strings and other domains, and suggests pattern rules for WordPress archives, feeds and dated permalinks.

  • Free, no sign-up
  • Results in seconds
  • Input not stored
mohitgoyal.in/tools/redirect-map-builder

Redirect Map Builder

Turn old WordPress URLs into Next.js redirects

Your input

One per line, up to 2,000 lines. Separate old and new with a space, a comma or ->.

Runs in your browser. Your list is never sent anywhere.

Result · Ready

Your result will appear here

Fill in the form, or press Try an example to see what you get:

  • A redirects() array for next.config.js with permanent: true
  • Chains pointed straight at the final page and loops left out
  • Warnings for duplicates, trailing slashes, query strings and other domains
  • Pattern rules for categories, tags, authors, pagination, feeds and dated permalinks
  • Notes for /?p= post links and media under /wp-content/uploads/

How it works

How to use the Redirect Map Builder

  1. Paste your URLs

    List the old WordPress URLs one per line, for example from your sitemap or Search Console. Add the new URL after each one whose address changes.

  2. Build the map

    The builder runs in your browser. It cleans each path, matches query strings with has conditions and turns WordPress archives and dated permalinks into pattern rules.

  3. Fix and paste

    Read the warnings, then copy the redirects() function into next.config.js and test a few old URLs before launch.

What you get

Inside every result

  • A redirects() array for next.config.js with permanent: true
  • Chains pointed straight at the final page and loops left out
  • Warnings for duplicates, trailing slashes, query strings and other domains
  • Pattern rules for categories, tags, authors, pagination, feeds and dated permalinks
  • Notes for /?p= post links and media under /wp-content/uploads/

Who it's for

Built for

  • Teams moving a WordPress site to Next.js
  • Developers preparing a launch-day redirect list
  • SEOs checking a migration plan for chains and loops
  • Agencies rebuilding a client's WordPress blog

Why the redirect map matters

Every old URL that has links, rankings or bookmarks should either stay the same on the new site or redirect permanently to its closest new page. One that returns 404 after launch breaks every link pointing to it.

In Next.js, redirects() in next.config.js returns a list of rules, each with a source, a destination and permanent: true, which sends a 308 permanent redirect. Redirects run before pages and files in /public.

What the builder checks

A chain is a redirect that lands on another redirect; the builder points the first URL straight at the final page. A loop sends a URL back to where it started, so it is left out. A source listed twice keeps its first rule.

Next.js removes trailing slashes by default before your own redirects run, so sources and destinations are written without them. A query string can't go in a source, so it is matched with a has condition. Old URLs on your domain become paths; another domain is kept as a full URL and flagged.

WordPress URL patterns

WordPress creates URLs you may not rebuild: category, tag and author archives, /page/2/ pagination, /feed/ URLs and dated permalinks such as /2023/05/slug/. Listed without a new URL, each type gets one pattern rule instead of a line per URL, such as /:year/:month/:slug to /blog/:slug.

Two cases need you. A /?p=123 link uses a post ID, so add the post's new URL after it. Media under /wp-content/uploads/ keeps working with no redirect if you copy the files into public/wp-content/uploads in the Next.js project.

Guides and services

Questions

Frequently asked

Is this tool free? Does it use AI?+

Yes, it is free with no sign-up. It does not use AI: it applies fixed rules to your list, and every warning is written by hand.

Is my URL list uploaded or stored?+

No. The builder runs entirely in your browser, so the list never reaches this site's server.

How many URLs can I paste?+

Up to 2,000 lines at a time. Split a bigger list and build it in parts, or let pattern rules cover whole sections such as category archives.

What if I only paste old URLs?+

Old URLs that match a WordPress pattern get a pattern rule. A /?p= link is flagged because it needs a new URL. Any other old URL keeps its path, so it needs no redirect as long as the new site has a page there.

Why are trailing slashes removed?+

Next.js defaults to trailingSlash: false, which redirects /page/ to /page before your own redirects run. Writing rules without the slash avoids an extra hop. If your next.config.js sets trailingSlash: true, add the slashes back.

Does the output work on Vercel?+

Yes, and on any Node.js server running Next.js. They don't apply to a static export (output: 'export'), because there is no server to send them; add the rules to your host's redirect config instead.

More free tools

Try another tool

All 21 tools →

Let's build

Have a site that needs to be fast, rank and convert?

Open to Work. Usually replies within a day.