---
title: "WordPress to Sanity: How to Migrate Without Losing Rankings"
description: "A practical WordPress to Sanity migration playbook for keeping rankings: pre-migration snapshots, URL maps, 301 redirects, metadata parity, schema, and 90-day monitoring."
author: "Hardik Desai"
date: 2026-08-21
tags: [WordPress to Sanity, Website Migration, SEO Migration, Redirects, Sanity SEO]
canonical: https://sanity-plugin-seofields.thehardik.in/blog/wordpress-to-sanity-migration-seo
---

# WordPress to Sanity: How to Migrate Without Losing Rankings

Moving from WordPress to Sanity changes how content is stored, edited, and rendered. The migration itself rarely causes ranking loss. What causes loss is the quiet drift that happens around it: URLs that change shape, redirects that never get written, metadata that does not survive the move, and structured data that disappears along with the theme.

This guide walks through the migration in the order that protects rankings: snapshot first, map URLs second, then rebuild content, metadata, and rendering with parity checks at every step.

> **[INFO]** **The rule that saves your rankings**
The one rule that matters most: if a URL changes, it needs a 301 redirect. If a URL can stay the same, keep it. Almost every major ranking drop after a CMS migration traces back to a broken redirect map.

## 1. Take a pre-migration SEO snapshot

Before anything changes, export the data you will need to compare against later. From Google Search Console, export queries and pages for the last 12 months with clicks, impressions, CTR, and position. From analytics, export top landing pages and conversion paths. Crawl the WordPress site to capture current titles, meta descriptions, H1s, canonicals, robots directives, and schema per URL. This snapshot is your rollback baseline and your proof of what changed if rankings move.

Also export the XML sitemap and the internal link graph. When you rebuild in Sanity you will re-create pages one at a time, and the snapshot tells you what each page used to say to search engines.

## 2. Map every URL before you write code

Build a three-column spreadsheet: old URL, new URL, action. The action is usually keep (URL unchanged), 301 (permanent redirect to the new URL), 410 (page intentionally removed), or merge (several old URLs consolidated into one). Aim to keep URLs identical wherever content maps one-to-one. That is the cheapest ranking insurance available.

WordPress URL patterns often include dates, categories, or .html extensions. Decide once, early, whether the new site keeps those patterns or moves to cleaner paths, then enforce the decision in the map. When you do redirect, point old URLs at their closest topical equivalent. Never blanket-redirect everything to the homepage, because search engines treat that as a soft 404.

## 3. Model your Sanity content to protect on-page SEO

WordPress themes generate titles and descriptions from templates. In Sanity, metadata becomes explicit fields, which is an upgrade, but only if the migration copies the values. Add an SEO object to every document type that publishes to a URL, then migrate each page's existing title, description, and social image into those fields instead of letting launch day regenerate them from scratch.

Preserve heading structure too. WordPress content arrives as HTML with its own H2 and H3 outline. When you convert that HTML to Portable Text, keep the hierarchy intact and render exactly one H1 per page, usually from the page template rather than the body.

## 4. Migrate content without breaking links and images

Internal links and images are where migrations leak the most equity. Extract every internal hyperlink from WordPress body content and rewrite the hrefs to the new URL structure during conversion. A script that applies your URL map here saves hours of manual fixes. For images, upload WordPress media to Sanity assets and update references, keeping file names and alt text.

Watch for WordPress-specific embeds such as galleries, shortcodes, and block variations with no direct Portable Text equivalent. Decide per type: convert to a custom block, flatten to plain content, or drop it. Whatever you choose, verify the rendered page still reads correctly. Content that silently disappears is a ranking problem and a user problem at the same time.

## 5. Carry structured data and social previews forward

WordPress SEO plugins usually emitted Article, Breadcrumb, and Organization schema quietly. In Sanity you own that markup. Define the schema.org objects in your content model, migrate the values, and render JSON-LD from the frontend. Compare before and after with a structured data test, because parity here is what keeps rich results alive through the move.

Do the same for Open Graph and Twitter cards. The snapshot from step one has each page's current social preview. Copy titles, descriptions, and images into the SEO fields so nothing regresses at launch.

## 6. Render redirects, sitemaps, and metadata on the frontend

Sanity holds the content, but redirects, XML sitemaps, robots.txt, and meta tags live in your rendering layer. Implement the redirect map from step two at the edge or in server config as permanent 301s, never client-side or 302s. Generate the sitemap from Sanity documents so it stays current, and render each page's SEO fields into the head with correct canonicals.

If you are also moving hosts, split the change into stages where possible: content migration first, DNS move second. Stacking changes makes it impossible to diagnose a ranking drop later.

## 7. Launch day checklist

On go-live day, work a fixed sequence: deploy redirects and verify a sample of old URLs return 301s to correct destinations; confirm the new sitemap resolves and contains every migrated URL; submit it in Search Console; check robots.txt and meta robots on key templates; spot-check titles, descriptions, canonicals, and JSON-LD on the top traffic pages; then watch crawl stats for spikes in 404s or soft 404s during the first 48 hours.

## 8. Monitor for 90 days, not 3 days

Rankings wobble for a few weeks after any migration while crawlers reprocess URLs. Compare against the pre-migration snapshot weekly: impressions by page, clicks by query, and index counts. Investigate pages whose impressions fall and stay down. The usual culprits are a missed redirect, a duplicated canonical, or a metadata field that never got filled.

> **[INFO]** **When to investigate a drop**
Treat any page with an impression drop that lasts more than two weeks as a defect. Find the missing redirect, canonical, or metadata before writing new content.

Keep the redirect map live for at least a year. Removing redirects too early is one of the few ways a settled migration starts losing rankings again months later.

A WordPress-to-Sanity migration protects rankings when parity is deliberate: every URL accounted for, every metadata field carried across, every rendering path verified. sanity-plugin-seofields gives editors the fields, validation, and scoring to keep that parity after launch. Install it, then run the SEO dashboard against your migrated pages to catch regressions before search engines do.
