Headless CMS SEO Setup Checklist
Going headless gives you speed and freedom, but you lose all the SEO features a normal CMS gives you for free: sitemaps, redirects, canonicals and meta tags. This prompt builds a complete SEO setup plan for your headless stack, splitting the work between CMS fields and front-end code.
Example input
This is exactly what we gave the model. You replace it with your own details.
- Website (or staging URL): https://staging.example.org (new site for a travel company) - Headless CMS: Sanity - Front-end framework and rendering: Next.js with static generation and on-demand revalidation - Hosting and CDN: Vercel - Page types: Home, destination pages, tour pages, blog posts, author pages, landing pages for ads - Languages or regions: English (UK) and German at /de/ - Is this a migration from an old site? Yes, from WordPress (about 900 URLs today)
Real output
Pasted straight from the model. We did not fix a word.
SEO setup plan: Sanity + Next.js + Vercel (travel site, EN-GB + DE, WordPress migration)
Questions first (I use these guesses in the plan below)
- Which Next.js version and router? Guess: Next.js 15 or 16 with the App Router. I flag version differences where they matter.
- What is the production host? Guess:
https://www.example.org, the same host WordPress uses today. That makes this a re-platform, not a domain move. - Will you keep the WordPress URL paths? Guess: yes for destinations, tours and posts, including WordPress's trailing slash (
/tours/amalfi-coast-walk/). Only WordPress-only URLs (tags, categories, attachments, feeds, date archives) go away. - Who is each language for, and is everything translated? Guess: English is for the UK first (
en-GB). German is for all German speakers (de). German slugs are translated, and not every page has a German version. The WordPress site already has German pages under/de/(WPML or Polylang). - Where do tour prices and dates come from? Guess: a booking system. A "from" price is synced into Sanity, and live dates and availability load in a client-side booking widget.
Smaller guesses, also labelled where they appear: the brand name is "Example Travel", Sanity Studio is embedded at /studio, and ad landing pages live under /lp/.
1. CMS field table (Sanity)
How to build it
- Make one reusable object type,
seo, and add it to every page type in an "SEO" field group. Use one shared image type with alt text everywhere, including inside Portable Text. - Use
Rule.max(60).warning()-style rules for soft limits, so editors can still publish. Use errors only for things that break URLs, links or translations. - Translations: use document-level i18n with
@sanity/document-internationalization. That gives one document per language, each with its own slug and SEO fields, linked throughtranslation.metadatadocuments. Plugin note: current versions of the plugin need Sanity Studio v3 or later. - Build structured data from normal content fields. Editors never paste raw JSON-LD.
| Content type | Field | Type | Validation | Default |
|---|---|---|---|---|
All page types (seo object) | seo.title | string | Warning over 60 characters, counting the brand suffix the front end adds; error over 70. German titles run longer, so warn, don't block | Empty → page title + brand suffix |
| All page types | seo.description | text (3 rows) | Warning under 70 or over 160 characters; required on Tour and Destination | Empty → summary/excerpt, cut at about 155 characters on a word break |
| All page types except Home | slug | slug | Required; only a–z, 0–9 and -; max 75 characters; unique per type and language (custom isUnique); custom slugify turns ä/ö/ü/ß into ae/oe/ue/ss | Generated from title |
| All page types | seo.canonicalOverride | url | Optional; must be an absolute https://www.example.org/… URL; shows a warning when filled, and another if noindex is also on | Empty = self-canonical (built by the front end) |
| All page types | seo.noindex | boolean | Field description warns: "removes this page from Google and the sitemap" | false (Landing page: true) |
| All page types | seo.ogImage | image (hotspot on) | Min 1200 × 630 px. A custom validator reads the size from the asset ID (image-…-1200x630-jpg) | Empty → hero/main image → site default |
| All page types | language | string, read-only | en-GB or de | Set by the i18n plugin |
| All page types | Translations (source for hreflang) | plugin's translation.metadata (references) | One document per language; same document type | Linked by editors from the "Translations" menu |
| All migrated documents | legacy (wpId, wpUrl) | object, read-only | wpUrl unique | Filled by the import script |
| Every image field | alt + decorative | string + boolean | alt required unless decorative is on; max 125 characters | Imported from the WordPress media library alt text |
| Home (singleton per language) | title (H1) | string | Required | — |
| Home | featuredDestinations, featuredTours | array of references | At least 3 each (gives crawl paths to key pages) | — |
| Destination | title (H1) | string | Required, max 70 | — |
| Destination | parent | reference → Destination | Can't reference itself; max 2 levels (e.g. Italy → Amalfi Coast) | Empty = top level |
| Destination | summary | text | Required, 100–300 characters | — |
| Destination | heroImage | image + alt | Required | — |
| Destination | body | Portable Text | Required; warning under ~300 words (thin page) | — |
| Destination | geo | geopoint | Optional | Empty |
| Destination, Tour | faqs | array of {question, answer} | Max 10; question and answer both required | Empty |
| Tour | title (H1) | string | Required, max 70 | — |
| Tour | destinations | array of references → Destination | At least 1; the first one is primary (breadcrumb) | — |
| Tour | summary | text | Required, 100–300 characters | — |
| Tour | heroImage, gallery | image + alt | Hero required | — |
| Tour | durationDays | number | Whole number, 1–60 | — |
| Tour | itinerary | array of {day, title, description, places → Destination} | Day numbers unique and in order | Empty |
| Tour | priceFrom + currency | number + string list | priceFrom > 0; currency GBP or EUR | Synced from the booking system and read-only for editors (guess); GBP on en-GB, EUR on de (guess) |
| Tour | bookingId | string, read-only | Required when the tour is bookable | From sync |
| Tour | status | string list (active, discontinued) | If discontinued, a replacement reference is required | active |
| Blog post | title (H1) | string | Required, max 100 | — |
| Blog post | excerpt | text | Required, 100–200 characters | — |
| Blog post | mainImage | image + alt | Required | — |
| Blog post | author | reference → Author | Required | — |
| Blog post | publishedAt | datetime | Required | Now, on create |
| Blog post | updatedAt | datetime | Optional; must be after publishedAt; set only for real content updates | Empty |
| Blog post | relatedDestinations, relatedTours | array of references | Warning if both are empty (no internal links) | — |
| All Portable Text | Link annotations | internalLink (reference), externalLink (url + rel: none, nofollow, sponsored) | Internal links must be references, never typed URLs; external links must be https | rel = none |
| Author | name | string | Required | — |
| Author | jobTitle | string | Optional, max 60 | — |
| Author | bio | text | Required, at least 150 characters | — |
| Author | photo | image + alt | Required | — |
| Author | sameAs | array of url | https only; max 6 | Empty |
| Author | knowsAbout | array of references → Destination | Optional | Empty |
| Landing page (ads) | slug | slug | Must sit under /lp/ (guess) | From title |
| Landing page | seo.noindex | boolean | Warning when turned off: "only if this page has unique content" | true |
| Site settings (singleton per language) | siteName, titleSuffix | string | Required; suffix max 20 characters | "Example Travel" (guess) |
| Site settings | defaultOgImage | image | Required, min 1200 × 630 | — |
| Site settings | organization (legal name, logo, phone, email, address, sameAs, memberships such as ABTA/ATOL if you have them) | object | Logo at least 112 × 112 px; all URLs https | — |
| Redirect | from | string | Required; starts with /; lowercase; no domain and no ?; ends with / unless it is a file path; unique | — |
| Redirect | to | string | Required; starts with / or https://; not the same as from; must not be another redirect's from (no chains) | — |
| Redirect | permanent | boolean | — | true (308) |
| Redirect | source | string list (migration, editor, slug-change), read-only | — | Set automatically |
| Redirect | note | text | Optional | — |
2. Front-end requirements checklist (Next.js on Vercel)
2.1 Rendering per page type
| Page type | Rendering | Revalidated when | Notes |
|---|---|---|---|
Home (/, /de/) | Static | Home doc, site settings or a featured doc changes | — |
| Destination | Static, generateStaticParams for every published slug × language; dynamicParams = true so new pages render on first request | Any Destination change; old and new path on slug change | Tour lists rendered on the server |
| Tour | Static | Any Tour change; plus a time-based fallback (e.g. hourly) in case a price sync misses a webhook | "From" price in the HTML; live availability in a client island |
| Blog post | Static | Post or its author changes | Blog index pagination as real URLs: /blog/page/2/ |
| Author | Static | Author or any of their posts changes | Lists all their posts as links |
| Ad landing page | Static | Landing page changes | noindex; not blocked in robots.txt |
| Draft preview | Dynamic, only in Draft Mode | — | Never cached publicly; always noindex |
- Main content, title, meta tags, canonical and JSON-LD are in the server-rendered HTML. Use
"use client"only for interactive parts (booking widget, gallery, map, filters). Test:curl -s URL | grep "a sentence from the body". - Content pages don't read
cookies(),headers()orsearchParams. Any of these makes the route dynamic, and it loses the static cache. Readgclid/UTM values in the browser instead. - All server fetches use Sanity
perspective: 'published'. Version note: from API version2025-02-19this is the default. With an olderapiVersionplus a token, the default israw, which can leak drafts into pages and sitemaps. - Server fetches that fill the Next.js cache use
useCdn: false. Otherwise a revalidation that runs right after a webhook can cache stale data. The Next.js cache already absorbs the traffic. -
/api/revalidatechecks the Sanity webhook signature (parseBodyfromnext-sanity/webhook), then revalidates by tag. Tag by document type: it's simple and safe at your size. On a slug change, also revalidate the old path and the sitemap. - Tell "missing" apart from "failed". If Sanity returns
null, callnotFound(). If the request fails (timeout, 5xx), throw, so ISR keeps serving the last good version. Never turn a failed fetch into a 404, or ISR will cache a 404 for a real tour page. - Version note: the cache APIs differ by version. Next.js 14/15 use
fetch(..., { next: { tags } })+revalidateTag(tag). Next.js 16 adds Cache Components ('use cache',cacheTag), and itsrevalidateTagtakes a second cache-profile argument.next-sanity'sdefineLive/sanityFetchwraps much of this. Pick one approach and use it everywhere.
2.2 One URL builder
- One function, e.g.
resolveHref({ _type, language, slug }), builds every URL: links, canonicals, hreflang, sitemaps, redirects andog:url. - Path prefixes per type and language live in one config file, e.g. tour →
/tours/and/de/reisen/. Guess on the German folder names: if WordPress already has German folder names, keep those. - Output is always lowercase with a trailing slash (to match
trailingSlash: true, guess 3). - The base URL comes from
NEXT_PUBLIC_SITE_URL=https://www.example.org, set for the Production environment in Vercel. Never useVERCEL_URLfor canonicals or sitemaps: it is the deployment URL (*.vercel.app).
2.3 Head tags (Metadata API)
- Every page has its own
generateMetadata, built by one helper,buildMetadata(doc, lang). Version note: in Next.js 15+,paramsis a Promise (const { slug } = await params). - The root layout for each language sets
metadataBaseandtitle: { template: '%s | Example Travel' }(brand is a guess). - Title =
seo.titleortitle. Description =seo.descriptionorsummary/excerpt, cut at about 155 characters. - One canonical per page. It is absolute and self-referencing unless
canonicalOverrideis set. It carries no query string, soutm_*,gclidandfbclidfrom your ads are dropped. Paginated pages point to themselves (/blog/page/2/→ itself, not page 1). - Never set
alternates.canonicalin a layout. Next.js merges metadata shallowly, so a page without its ownalternatesinherits the layout's canonical, and every page ends up canonical to the home page. Setcanonicalandlanguagestogether in the page'salternatesobject. - Robots meta:
robots: { index: false, follow: true }whennoindexis on. Landing pages arenoindexby default. - hreflang via
alternates.languages:en-GB,deandx-default(rules in 3.6). - Open Graph and Twitter:
og:title,og:description,og:url(= canonical), andog:imageat 1200 × 630, built with@sanity/image-urlusing the hotspot crop. Alsoog:locale(en_GB/de_DE),og:typearticleon posts, andtwitter:cardsummary_large_image. -
<html lang="en-GB">/<html lang="de">. This needs the root layout underapp/[lang]/. Middleware rewrites/tours/x/to/en/tours/x/internally (the visitor still sees/tours/x/). A direct request to/en/...gets a 308 to the unprefixed URL. Version note:middleware.tsis calledproxy.tsfrom Next.js 16. - Version note (Next.js 15.2+): on dynamically rendered routes, metadata can stream into the body for user agents not on the
htmlLimitedBotslist. Your static pages are not affected. If any route becomes dynamic, add AI crawlers (GPTBot, OAI-SearchBot, ClaudeBot, PerplexityBot) tohtmlLimitedBots, or test that metadata is in<head>. - Check the raw HTML of every template with
curl, not in a browser: exactly one canonical, one title, one description, and no leftover tags from third-party scripts.
2.4 JSON-LD
- Render it on the server in the page component as
<script type="application/ld+json">. Serialize withJSON.stringify(data).replace(/</g, '\\u003c')(the Next.js docs recommend this to prevent XSS). - Type it with
schema-dts(TypeScript types for schema.org).
| Page | JSON-LD | Notes |
|---|---|---|
| Home | Organization + WebSite | Use TravelAgency instead if customers visit an office (guess: they don't). Logo, sameAs, contact details. Skip SearchAction: Google retired the sitelinks search box in Nov 2024 |
| Destination | TouristDestination + BreadcrumbList | No Google rich result, but it helps entity understanding and AI answers |
| Tour | TouristTrip with offers (Offer: price, priceCurrency, availability, url), provider, itinerary + BreadcrumbList | Don't mark tours up as Event: Google's event guidelines exclude travel packages. Review stars only with real reviews of that tour shown on the page, and the rich result isn't guaranteed |
| Blog post | BlogPosting (headline, image, datePublished, dateModified, author → Person with the author page URL, publisher) + BreadcrumbList | dateModified from updatedAt |
| Author | ProfilePage with mainEntity: Person (name, jobTitle, image, sameAs, knowsAbout) | — |
| Ad landing page | None needed | Page is noindex |
| FAQ blocks | FAQPage (optional) | Since 2023, Google shows FAQ rich results only for well-known government and health sites. Use it for understanding only |
- JSON-LD values match what's on the page (price, dates, author). If the price only shows in the client widget, leave
offersout. - Every template passes the Rich Results Test (BlogPosting, BreadcrumbList, ProfilePage) and the Schema Markup Validator (TouristTrip, TouristDestination).
2.5 Links
- Every internal link uses
next/link, which renders a real<a href>. NoonClick={() => router.push()}on divs or buttons for navigation. - Portable Text internal links are references, resolved through
resolveHrefat render time. A slug change never breaks a link, and links never point at a redirect. - The header, mega menu, footer and breadcrumbs are in the server HTML, not loaded on hover.
- Pagination uses
<a href="/blog/page/2/">, not just a "Load more" button. - Tour filters (duration, month, price) are UI state: the canonical points to the clean listing. If a filter combination deserves to rank (e.g. "walking tours in Italy"), make it a real page in Sanity.
- The language switcher links to the real translation from the translation metadata. If there is no translation, it links to the German home page.
- Partner and affiliate links get
rel="sponsored"ornofollowfrom the Portable Text field.
2.6 Images
-
next/imagewith a custom loader that builds Sanity CDN URLs (@sanity/image-url,auto=format, set width steps) forsrcset. Sanity already transforms images, so you don't pay twice for Vercel Image Optimization. That cost depends on your plan; Vercel's optimizer also works. -
altcomes from Sanity; usealt=""when the image is marked decorative. -
width/heightcome from the asset metadata (or the asset ID), so there is no layout shift. - Set
sizesper layout (hero100vw; cards(min-width: 1024px) 33vw, 100vw). - Only the hero (usually the LCP element) gets
priority(or its replacement in your Next.js version). Everything else lazy-loads (the default). - Blur placeholder from Sanity's
metadata.lqip. - Optional: Sanity vanity filenames (
…/image-id-2000x1333.jpg/amalfi-coast.jpg) for readable image URLs.
2.7 Status codes
- An unknown or unpublished slug calls
notFound()in bothgenerateMetadataand the page, before any<Suspense>. That gives a real 404 and a localizednot-found.tsx(English at root, German under/de/), with links to destinations and search. - No
loading.tsxon content routes. Once streaming starts, a 200 has already been sent, and a laternotFound()can't change it (Next.js only adds anoindexmeta tag). - If guess 1 is wrong and you use the Pages Router:
getStaticPropsreturns{ notFound: true }, withfallback: 'blocking'. - Removed WordPress URLs return 410 (see 3.5). Redirects are one hop, 308 or 301. Errors return 500, never a 200 "something went wrong" page.
- Empty search results and empty filtered listings are
noindex. - A CI test runs
curl -Ion known 200, 404, 410 and 308 URLs.
2.8 Core Web Vitals on this stack
Targets at the 75th percentile on mobile: LCP ≤ 2.5 s, INP ≤ 200 ms, CLS ≤ 0.1.
LCP
- Keep pages static so Vercel serves them from the edge cache (fast TTFB). See 2.1 for what makes a route dynamic.
- Hero image:
priority, correctsizes, Sanityauto=format(WebP/AVIF), quality around 75. - Load fonts with
next/font(self-hosted, preloaded, size-adjusted fallback). Two families at most. - Set the Vercel Functions region to London (
lhr1) or Frankfurt (fra1), so cache misses, revalidation and Draft Mode render near your UK and German users. The default region is in the US.
INP
- Keep client components small: the booking widget, gallery and map are islands. The map loads on click, with a static image as a placeholder.
- Third-party scripts: Google Tag Manager via
@next/third-parties; ad pixels vianext/scriptwithafterInteractiveorlazyOnload. Re-test whenever someone adds a tag. - Load the consent banner (needed for UK and German privacy law) without blocking rendering.
CLS
- Every image has width and height. Reserve space for the booking widget, review widget and map. The cookie banner overlays the page rather than pushing content down.
- Nothing gets inserted above existing content after load (promo bars included).
Measure
- Lighthouse CI on pull requests for the six templates, with a mobile LCP budget of 2.5 s.
- Field data from Vercel Speed Insights (depends on plan), plus the Search Console Core Web Vitals report after launch.
- Ad landing pages: speed also affects landing page experience in your ad platforms.
3. Site-level feature checklist
3.1 XML sitemaps
- A sitemap index at
/sitemap.xml, with one child per type:sitemap-pages.xml,sitemap-destinations.xml,sitemap-tours.xml,sitemap-posts.xml,sitemap-authors.xml. Each includes both languages. About 900 URLs × 2 languages would fit in one file (the limit is 50,000), but per-type files let you see indexing by type in Search Console. - Build them as route handlers (e.g.
app/sitemap-tours.xml/route.ts) for full control. The alternative isapp/sitemap.ts+generateSitemaps. Version note: some versions don't create the index file for you, so check. - Include only URLs that are published,
noindex = false, have no canonical override and return 200. Build them withresolveHref. Leave out landing pages, paginated pages, redirects and 404s. -
lastmod=_updatedAt(posts:updatedAtorpublishedAt), never the build time. - Put hreflang in the HTML head (3.6), not in the sitemaps. One method is easier to keep correct.
- Sitemaps are revalidated by webhook on every publish, unpublish and delete.
- The index is listed in robots.txt and submitted in Search Console and Bing Webmaster Tools.
3.2 robots.txt (app/robots.ts, depends on environment)
Production (www.example.org):
User-agent: *
Disallow: /api/
Disallow: /studio
Sitemap: https://www.example.org/sitemap.xml
- Don't block
/_next/: Google needs the CSS and JS to render pages. - Don't block
/lp/. Usenoindexon landing pages instead. A robots.txt block would hide thenoindexfrom Google, and Google's AdsBot ignoresUser-agent: *rules anyway. - On any non-production host or
VERCEL_ENV, the same file servesDisallow: /. This is only a backup; real protection is in 3.7. - Decide on AI crawlers on purpose. Guess: you want to appear in AI answers, so don't block GPTBot, OAI-SearchBot, ClaudeBot, PerplexityBot or Google-Extended. Google-Extended doesn't affect Google Search or AI Overviews. Also check that Vercel Firewall bot rules (such as an AI-bot managed ruleset, depending on plan) aren't blocking them.
3.3 One host, HTTPS, trailing slash, lowercase
- In Vercel → Project → Domains:
www.example.orgis the production domain, andexample.orgredirects to it (permanent). Vercel redirects HTTP to HTTPS automatically. - The
*.vercel.appproduction URL is either under Deployment Protection or getsX-Robots-Tag: noindex(middleware rule: host is notwww.example.org). -
trailingSlash: trueinnext.config(guess 3: it matches WordPress, so 900 URLs don't each need a slash redirect). Next.js 308-redirects the other form. - Middleware 308-redirects any path with uppercase letters to lowercase, and collapses
//. Skip/_next/,/api/and files. Work out the final URL first, then redirect once, so there are no chains. - Query parameters never create a new canonical.
3.4 Redirects manager
| Layer | Where | What | Who |
|---|---|---|---|
| 1. Host | Vercel Domains | Apex → www, HTTP → HTTPS | Front-end dev, once |
| 2. Code | next.config redirects() + middleware | URL normalization, WordPress pattern rules, the migration 1:1 map (redirects.json) and the 410 list (gone.json) | Front-end devs |
| 3. CMS | Sanity Redirect documents | Editor redirects and automatic slug-change redirects | Editors + automation |
- How Sanity redirects reach the site. Option A (simple, my pick):
next.configredirects()fetches the Redirect documents at build time, and a Sanity webhook on Redirect changes calls a Vercel Deploy Hook. Changes go live in a few minutes. Option B (instant): the webhook writes redirects to Vercel Edge Config and middleware reads it. Edge Config size limits depend on plan. - Limits: Vercel caps the number of redirects/routes per deployment (roughly 1,000–2,000, depending on version and config; check current limits). That's why the ~900-entry migration map lives in a middleware lookup, not in
next.config. Use Vercel's bulk redirects feature instead if your plan has it. - Slug change rule: when a published document's slug changes, a redirect from old to new is created automatically. Use a Sanity GROQ webhook with filter
_type in ["destination","tour","post","author"] && delta::changedAny(slug)and projection{"from": before().slug.current, "to": after().slug.current, language}. Its handler creates the Redirect document (source: slug-change) and revalidates both paths. A custom Studio document action is the alternative. - If a parent Destination's slug is part of child URLs, the handler also redirects every child path.
- Unpublish/delete rule: if the page had traffic, editors set a replacement (discontinued tours use the
replacementfield). Otherwise the page returns 404 or 410. - No chains: when A → B exists and B → C is created, the handler rewrites A → C. Validation blocks loops.
- Redirects are permanent by default. Keep migration redirects for at least a year, ideally forever. Every target must return 200 and be indexable.
3.5 404 and 410 handling
-
notFound()gives a real 404 with a localized, helpful page. Never redirect all 404s to the home page: Google treats that as a soft 404. - A 410 list (
gone.json, from the migration sheet) covers URLs removed on purpose: WordPress tags, attachment pages, date archives,/feed/(if you have no new feed) and old offers. Middleware returns status 410 with a small HTML page with links. - Log 404 paths (Vercel log drain or an analytics event on the not-found page) and review them weekly. Add redirects where needed.
3.6 hreflang
- Values:
en-GB(English, at root),de(German,/de/), andx-defaultpointing to the English version (guess 4). - Generated from Sanity's translation metadata. Never typed by hand.
- Each page lists itself and each translation, both ways (EN ↔ DE), using absolute canonical URLs.
- A translation is included only if it is published, indexable, self-canonical and returns 200. Otherwise the pair is dropped on both sides.
- No automatic redirects by browser language or IP. Googlebot crawls mostly from the US without an
Accept-Languageheader, so it would only ever see one version. If you usenext-intl, setlocaleDetection: falseandlocalePrefix: 'as-needed'. Show a dismissible "Auf Deutsch lesen" banner instead. -
/en/…paths 308-redirect to the unprefixed URL, so each English page has exactly one URL.
3.7 Preview and staging safety
- Vercel Deployment Protection is on for all preview deployments and for
staging.example.org. Vercel Authentication is available on all plans; Password Protection depends on plan. Test in an incognito window: you should see a login screen, not the site. -
X-Robots-Tag: noindex, nofollowon every response whenVERCEL_ENV !== 'production'or the host isn'twww.example.org. Vercel adds a noindex header to preview URLs by default, but don't rely on that for your custom staging domain. - Staging robots.txt serves
Disallow: /as a backup. - Draft Mode (Sanity Presentation tool) is enabled only through the secret route from
next-sanity(defineEnableDraftMode). Draft pages always outputnoindexand are never cached publicly. - The Sanity read token is server-only and never in a
NEXT_PUBLIC_variable. - The
/studioroute isnoindex(recent versions ofnext-sanity's studio metadata export do this; check) and disallowed in robots.txt. - Test scripts and crawlers reach staging through Vercel's Protection Bypass for Automation (the
x-vercel-protection-bypassheader). Never turn protection off for testing. - After launch, the old WordPress server can't be reached on any other host (an
old.subdomain or the server IP), or it is protected andnoindex.
3.8 Migration: redirect and URL mapping plan (WordPress → Sanity + Next.js)
Step 1: Inventory every URL, not just the ~900 pages. Sources:
- a crawl of the live site (Screaming Frog or Sitebulb)
- the WordPress/Yoast/Rank Math XML sitemaps
- a Search Console pages export (16 months)
- GA4 landing pages (12 months)
- backlinks (Search Console Links, plus Ahrefs/Semrush if you have them)
- server logs, if available
Catch the WordPress-only URL types: /de/ translations, /category/…, /tag/…, /author/…, /page/2/, /feed/, date archives (/2024/05/), attachment pages, /?p=123 shortlinks, /amp/ (if you used AMP), and /wp-content/uploads/… images and PDFs. Some of those have backlinks and image traffic.
Step 2: Score each URL by clicks, referring domains and bookings/enquiries.
- Tier A: the top ~100
- Tier B: anything else with traffic or links
- Tier C: no traffic, no links
Step 3: Decide an action for each URL.
- Keep the same path. This is the best option: no redirect, just check content parity.
- 1:1 redirect to the matching new page.
- Merge. Several thin posts become one page, and all of them redirect to it.
- Closest relevant page. A discontinued tour redirects to its replacement tour or its destination page, but only if that page truly serves the same need. If a discontinued tour has strong backlinks, you can instead keep it live (200) with a "no longer available" note and alternatives.
- 410 when there's no relevant replacement.
Step 4: Mapping sheet columns
old_url · lang · wp_type · status_now · clicks_16m · ref_domains · tier · action (keep / redirect / merge / 410) · new_url · owner · staging_result · notes
Step 5: Implement
- Pattern rules in
next.configredirects()cover many URLs in a few lines. Examples (adjust to your real permalinks):/:year(\d{4})/:month(\d{2})/:slug/ → /blog/:slug/ (only if posts used date permalinks) /author/:slug/ → /authors/:slug/ (guess at the new path) /:path*/amp/ → /:path*//tag/…,/category/…(unless mapped to a hub page) and/…/feed/go to the 410 list. - The 1:1 list becomes
redirects.json, read by middleware. The 410 list becomesgone.json. /?p=123shortlinks: middleware readspand looks uplegacy.wpId.- Image URLs with backlinks redirect to the new page or the Sanity image. The rest can 410.
Step 6: Migrate the content with parity
- Import through the WordPress REST API (
/wp-json/wp/v2/posts,pages, and the tour/destination post types if they haveshow_in_rest). - Yoast adds
yoast_head_json(title, description, canonical, robots) to REST responses: import it into theseofields. Rank Math needs its headless support setting turned on (plugin-dependent). - Convert HTML to Portable Text with
htmlToBlocksfrom Sanity's block-tools package (the package name differs by version). - Rewrite internal links as references using the mapping sheet. Upload images with their alt text. Keep the published and modified dates, the authors and the EN ↔ DE links from WPML/Polylang. Store
legacy.wpId/wpUrl. - Carry over the WordPress
noindexsettings, so pages like thank-you pages don't suddenly become indexable.
Step 7: Test on staging (with the bypass header)
- Every old URL returns 200 (kept), a single-hop 301/308 to a 200 page, or a 410. No chains, and no 404s for Tier A or B.
- Crawl staging: zero internal links to redirects or 404s, and canonicals and hreflang are correct.
- Compare the Tier A pages old vs new: title, H1, word count, number of internal links, JSON-LD.
Step 8: Launch day
- Avoid your peak booking weeks. For UK travel that is often January, but this is a guess, so check your own data.
- Lower the DNS TTL a few days before, then point DNS to Vercel.
- Run the old-URL test against production straight away.
- Submit the new sitemap index in Search Console. No Change of Address is needed (same domain, guess 2).
- Optional: submit a temporary sitemap of the old redirected URLs to speed up recrawling, and remove it after about a month.
- Point ad final URLs at the new URLs.
- Keep a full WordPress backup.
Step 9: After launch (8–12 weeks)
- In the first week check daily, then weekly: the Search Console Pages report (Not found, Page with redirect, Duplicate canonical, Crawled – not indexed), crawl stats, and your 404 log. Add redirects as needed.
- Track clicks and rankings for Tier A pages against your pre-launch baseline. Some movement in the first few weeks is normal.
4. Pre-launch checklist
Indexing and safety
- Canonicals,
og:url, sitemap URLs and hreflang all usehttps://www.example.org, never staging or*.vercel.app. - Production has no
X-Robots-Tag: noindex(curl -sI https://www.example.org/ | grep -i robotsreturns nothing) and nonoindexmeta tag, except on landing pages and pages meant to be noindex. - Production robots.txt is the production version (no
Disallow: /). -
staging.example.organd preview URLs are protected (incognito test) and send the noindex header. -
example.org,http://and the*.vercel.appURL redirect tohttps://www.example.org/or are protected/noindex. - Draft content never shows for a logged-out visitor, and the Sanity token isn't in the client bundle (search the build output for it).
Technical SEO
-
/robots.txtand/sitemap.xmlreturn 200 directly, with no trailing-slash redirect. - Status tests pass: a fake URL → 404 (at root and under
/de/); an unpublished slug → 404; 410 list → 410;/Tours/X/→ 308 to lowercase; a URL without the trailing slash → 308 to the slash version. - Exactly one canonical on all six templates, checked in the raw HTML.
- Main content, title, description, canonical, hreflang and JSON-LD are in the raw HTML (check with curl or with JavaScript off).
- hreflang pairs are reciprocal,
x-defaultis present, and there are no hreflang links to noindex or redirected pages. - JSON-LD passes both validators, and tour prices match the page.
- Sitemaps contain only 200, indexable, canonical URLs, and the counts per type match Sanity's count of indexable documents.
- A crawl finds zero internal links to 404s or redirects, and no orphan tours or destinations.
- Revalidation works: edit a tour title and the live page updates within a minute. Change a slug, and the redirect is created and the old URL returns 308.
Content
- Tier A pages: SEO title, description, H1, body and internal links signed off in both languages.
- Every image has alt text or is marked decorative.
- Author pages are complete. Trust pages exist in both languages: about, contact, booking terms, privacy, an Impressum for German visitors (required by German law), and ABTA/ATOL details if they apply.
Performance
- Mobile lab test for each template: LCP under 2.5 s, CLS under 0.1, low Total Blocking Time. Landing pages included.
Tracking
- Search Console domain property (DNS-verified) and Bing Webmaster Tools ready. GA4/GTM and the consent banner work, and booking/enquiry conversions are tested.
Migration
- 100% of old URLs tested: 200, a single-hop 301/308, or 410.
- WordPress SEO data imported, ad final URLs ready to switch, DNS TTL lowered, WordPress backup taken, launch date outside peak booking weeks, team available for two weeks after launch.
5. Tickets grouped by team
P1 = before launch, P2 = soon after launch.
CMS developers (Sanity)
| ID | Ticket | Done when | Priority |
|---|---|---|---|
| CMS-01 | Reusable seo object + "SEO" field group | On all page types, with the validation from section 1 (warnings for length, errors for slugs) | P1 |
| CMS-02 | Slug rules | Custom slugify (lowercase, umlauts), unique per type + language, max length; published slugs show "changing this creates a redirect" | P1 |
| CMS-03 | Document-level i18n | @sanity/document-internationalization on all page types and site settings; EN ↔ DE linking works | P1 |
| CMS-04 | Shared image type with alt | alt + decorative on every image, including in Portable Text; OG image size validator | P1 |
| CMS-05 | Structured content fields | Tour (destinations, price, currency, duration, itinerary, status/replacement), Destination (parent, geo, FAQs), Author (jobTitle, sameAs, knowsAbout), Post (dates, author) | P1 |
| CMS-06 | Portable Text links | internalLink reference annotation + externalLink with rel; no typed internal URLs | P1 |
| CMS-07 | Redirect document type | Format, uniqueness, no-self and no-chain validation | P1 |
| CMS-08 | Auto-redirect on slug change | GROQ webhook (delta::changedAny(slug), before()/after()) creates the Redirect, fixes chains and handles child paths; tested on all types | P1 |
| CMS-09 | Webhooks to the site | Publish/unpublish/delete → signed webhook to /api/revalidate; Redirect changes → Vercel Deploy Hook | P1 |
| CMS-10 | Site settings singleton | Organization data, logo, default OG image, social profiles, memberships | P1 |
| CMS-11 | WordPress import script | Pages, posts, tours, destinations, authors and images (with alt) imported; Yoast/Rank Math fields; legacy IDs; EN ↔ DE links; HTML → Portable Text; internal links → references | P1 |
| CMS-12 | Draft preview | Presentation tool + Draft Mode on protected environments; token server-only | P1 |
| CMS-13 | "SEO issues" lists in the Structure tool | GROQ-filtered lists: missing description, noindex on, canonical override set, missing translation, image without alt, tour without price | P2 |
| CMS-14 | Character counters / SERP preview | A custom input component (or a community SEO plugin) showing title and description length | P2 |
Front-end developers (Next.js / Vercel)
| ID | Ticket | Done when | Priority |
|---|---|---|---|
| FE-01 | Routing + i18n | app/[lang], English unprefixed via middleware rewrite, /en/* → 308, correct <html lang>, no automatic language redirect | P1 |
| FE-02 | resolveHref URL builder | Used by links, canonicals, hreflang, sitemaps, redirects and OG tags; unit-tested | P1 |
| FE-03 | URL normalization | trailingSlash: true; lowercase and // rules in middleware; one redirect hop | P1 |
| FE-04 | Metadata helper | buildMetadata() for title, description, canonical, robots, hreflang and OG/Twitter; metadataBase from NEXT_PUBLIC_SITE_URL; no canonical in layouts | P1 |
| FE-05 | Data layer + revalidation | perspective: 'published', server useCdn: false, tags by type, generateStaticParams, signed /api/revalidate (old + new paths), null → 404 vs error → throw | P1 |
| FE-06 | Status codes | notFound() before Suspense; no loading.tsx on content routes; localized 404 pages; 410 via middleware; curl -I tests in CI | P1 |
| FE-07 | JSON-LD components | Organization/WebSite, TouristDestination, TouristTrip + Offer, BlogPosting, ProfilePage, BreadcrumbList with schema-dts and safe serialization; validators pass | P1 |
| FE-08 | Redirect engine | Vercel domain redirect, next.config patterns, middleware maps (redirects.json, gone.json, ?p= lookup), Sanity redirects at build | P1 |
| FE-09 | Sitemaps | Index + per-type files, filter rules, real lastmod, revalidated on publish | P1 |
| FE-10 | robots + noindex safety | Environment-aware robots.ts; X-Robots-Tag on non-production hosts; Draft Mode and /studio noindex | P1 |
| FE-11 | Links + navigation | next/link everywhere, Portable Text link resolver, breadcrumbs, pagination links, language switcher to the real translation | P1 |
| FE-12 | Images | Sanity loader for next/image, alt, dimensions, sizes, LQIP, hero priority | P1 |
| FE-13 | Core Web Vitals | next/font, script strategies, non-blocking consent banner, client-island audit, lhr1/fra1 region, Lighthouse CI budgets, Speed Insights | P1 |
| FE-14 | Landing page template | noindex by default, not in the sitemap, not blocked in robots.txt, minimal JS | P1 |
| FE-15 | Vercel domains + protection | www as primary, apex redirect, Deployment Protection on previews and staging, *.vercel.app handled | P1 |
| FE-16 | Pre-launch test script | Runs the old-URL list and a crawl against staging with the bypass header; reports status, hops, canonical, robots, hreflang reciprocity, title/description length | P1 |
| FE-17 | 404 monitoring | 404 paths logged and sent as a weekly report | P2 |
Editors
| ID | Ticket | Done when | Priority |
|---|---|---|---|
| ED-01 | Fill the URL mapping sheet | Every old URL with traffic or links has an action (keep / redirect target / merge / 410); Tier A reviewed by a person | P1 |
| ED-02 | SEO titles + descriptions for Tier A | Unique and within limits in EN and DE; German written or reviewed by a native speaker | P1 |
| ED-03 | Content parity review | Tier A pages match or improve on WordPress: H1, body, FAQs, images, internal links | P1 |
| ED-04 | Alt text audit | Every imported image has alt text or is marked decorative | P1 |
| ED-05 | Tour and destination data | Every active tour has price, duration, itinerary, destinations and FAQs; discontinued tours have a replacement | P1 |
| ED-06 | Author profiles | Bio, photo, job title, sameAs and expertise for every author | P1 |
| ED-07 | Link translations | Every German page linked to its English version; a list of pages with no translation | P1 |
| ED-08 | Editor training | Team knows: slug changes create redirects; when to use noindex; canonical override is rare; landing pages stay noindex; internal links go through the link picker | P1 |
| ED-09 | Update ad final URLs | All ads point to new URLs, not redirects (launch day) | P1 |
| ED-10 | Post-launch checks | Weekly Studio "SEO issues" lists and Search Console 404 review for 8 weeks | P2 |
The prompt
First lines open so you can see how it is built. The rest opens after purchase.
#ROLE You are a technical SEO architect who has launched many headless websites. Create a complete SEO setup plan for my headless build. #INPUTS Fill in every line. Leave a line blank if you don't know it. - Website (or staging URL): [URL] - Headless CMS: [e.g., Contentful, Sanity, Strapi, Storyblok, headless WordPress, Shopify Hydrogen] - Front-end framework and rendering: [e.g., Next.js with SSG/ISR, Nuxt SSR, Astro]
How to use it
- Buy, then open it in your account.
- Copy the prompt into ChatGPT, Claude or Gemini.
- Replace the 7 inputs with your product.
- Run it. Use the output. Re-run with a different tone if you like.
Pro tips
- Build the SEO fields into the CMS content model on day one. Adding them later means editing every page twice.
- Block preview and staging with a password and a noindex header, and check the header doesn't reach the live site.
- Use the pre-launch checklist as a real gate before you switch DNS.
Before you buy
- Will it work for my product?
- Yes, if you can fill the 7 inputs. If the output is bad with your inputs, email us: we fix the prompt and refund you.
- Do I download a file?
- No. It lives in your account with a copy button, and updates when we improve it.
- Which model is best?
- Best on Claude. Works in ChatGPT, Claude and Gemini.
Works well with this
Prompts people use in the same campaign.
More in Ecommerce, CMS & JavaScript
Buying more than two? Lifetime is cheaper.
Every prompt, every category, forever. $59 once. Nothing to download, nothing to renew.
This prompt
$3$7
- ✓ Instant access in your account, with a copy button
- ✓ Example input and real output included
- ✓ 7-day money-back, no form
Or get every prompt, forever
Lifetime Access · $59 $149 — all categories, all future prompts, rewrites included.
Get lifetime accessCard or PayPal · taxes at checkout · nothing to download
Not the one you need?
Browse every prompt by category and sub-category.