Prompt

How do I migrate from WordPress to a headless CMS without breaking URLs?

Technology / Developer Tools1 observationLast seen Oct 21, 2026

Latest observation

Oct 21, 2026OpenAI APIWeb search: off

To migrate from WordPress to a headless CMS without breaking URLs, the key is to preserve your existing URL structure and set up a clean redirect strategy for anything that changes.

1) Audit your current URLs

Export or crawl your WordPress site and make a list of:

  • Post URLs
  • Page URLs
  • Category/tag URLs
  • Author archives
  • Media/file URLs
  • Any custom post type URLs
  • Old URLs that already redirect or 404

This becomes your migration map.

2) Keep the same URL patterns if possible

The easiest way to avoid broken links is to make the new frontend match WordPress URL patterns.

Examples:

  • WordPress post: /blog/my-post/
  • New site should also use: /blog/my-post/

If you can preserve:

  • slugs
  • URL nesting
  • trailing slash behavior
  • category paths
    you’ll avoid most redirects.

3) Create a URL mapping table

For every WordPress URL, define:

  • old URL
  • new URL
  • status: same / redirected / retired

Example:

Old URLNew URLAction
/about//about/keep
/2019/08/my-post//blog/my-post/301 redirect
/category/news//news/301 redirect

This is essential for preserving SEO and preventing broken links.

4) Set up 301 redirects

If any URL changes, use 301 redirects from old to new.

Where to implement them:

  • CDN / edge layer
  • Nginx / Apache
  • Next.js / Nuxt / Remix redirects
  • Cloudflare redirects
  • Hosting platform rules

Avoid relying only on WordPress redirects after decommissioning WP.

5) Keep slugs identical during migration

When importing content into the headless CMS:

  • preserve post slugs
  • preserve published dates if they affect URL structure
  • preserve category slugs if used in paths
  • preserve media file names/paths where possible

If you change slugs, you must redirect each old URL.

6) Handle media carefully

WordPress media URLs often appear in:

  • blog content
  • image tags
  • PDFs
  • embedded downloads

Options:

  • keep the same file paths on your new host/CDN
  • or migrate media and redirect old file URLs
  • update content references during import

If possible, keep old media URLs working indefinitely.

7) Mirror metadata and canonical tags

To avoid SEO issues:

  • keep page titles and meta descriptions where possible
  • set canonical URLs to the new live URL
  • ensure internal links point to the new URLs, not old WordPress URLs
  • regenerate XML sitemaps for the new site

8) Test before launch

Before switching DNS or going live:

  • crawl the staging site
  • verify every important old URL redirects correctly
  • check for 404s
  • confirm trailing slash behavior
  • test query strings and pagination
  • validate media links

Useful tools:

  • Screaming Frog
  • Sitebulb
  • Ahrefs / Semrush crawl tools
  • Google Search Console after launch

9) Launch in phases

A safe rollout:

  1. Build the headless frontend
  2. Import content into the new CMS
  3. Test URL parity
  4. Add redirects
  5. Switch traffic
  6. Monitor logs and Search Console for 404s
  7. Fix broken links quickly

10) Keep WordPress available temporarily

If possible, keep the old WordPress site live for a while behind redirects or on a staging subdomain. This helps if you discover missed URLs after launch.

Common pitfalls to avoid

  • changing slugs without redirects
  • forgetting author/category/tag archives
  • losing trailing slashes
  • breaking pagination URLs
  • not redirecting media files
  • changing case sensitivity
  • forgetting old campaign or landing page URLs

Best-practice approach

If URL preservation matters most:

  • replicate WordPress URL structure in the new frontend
  • use 301 redirects only for exceptions
  • preserve media paths
  • keep a full redirect map

If you want, I can also give you:

  1. a step-by-step migration checklist,
  2. a redirect mapping template, or
  3. an example setup for Next.js + headless CMS + 301 redirects.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.