Drag to move. Use arrow keys to move, Shift for larger steps, Home to reset, and Escape to drop.

WordPress to Astro, how to migrate without losing your SEO

How to get your content out of WordPress, what to preserve so rankings survive, and what replaces each plugin. Or Sherpa does it for you, free.

Graph paper with the title WordPress to Astro, without losing your SEO, beside a WordPress sticker with a dashed arrow pointing to a code sticker.

Moving a WordPress site to Astro means extracting the content from the database, recreating the theme as Astro pages, and replacing the functionality that plugins provided. The content is easy to get. WordPress has an export tool and a built-in API that returns all posts and pages. The end result is a website with no plugins to update, nothing to patch, and pages served as plain HTML. Some Sherpa customers have seen their mobile page speed score jump from around 50 to 90 after moving. The hard part is preserving the URLs, metadata, and redirects that keep your search rankings. This guide covers what WordPress gives you, what to preserve, and the steps to take. Sherpa can also do the entire migration for free, which is covered at the end.

What WordPress gives you

What comes out of WordPress
Comes with you
  • Posts, pages and custom post types
  • Categories, tags and custom fields
  • SEO titles and descriptions, through the API with Yoast
  • Media files, in /wp-content/uploads/
You rebuild
  • The theme, which is PHP templates
  • Everything plugins did
  • Forms, comments and search
  • Shortcodes, which come out as raw text
  • Redirect rules
Checked against the WordPress, Astro and Yoast docs on December 4, 2026.

Under Tools, then Export, WordPress downloads a WXR file. Its export docs list what's inside, which is your posts, pages, custom post types, comments, custom fields, categories, tags, custom taxonomies and users. That's a list of your content. Your theme, plugin features and the media files themselves aren't included. Images are referenced by URL and stay in /wp-content/uploads/ on the server.

The REST API is the better source. Astro's WordPress guide notes that it's on by default at /wp-json/wp/v2/ and needs no credentials to read. If your site runs Yoast SEO, the API also returns each page's SEO metadata. Yoast adds a yoast_head_json field with the title, description, canonical, Open Graph image and schema for every post. Astro's own migration guide points out that many WordPress plugins have no direct equivalent, so each one needs a decision.

Will a migration hurt your SEO?

Not if you migrate it correctly. There are a lot of rules, and this section covers them in order of importance. The design is the easy part of leaving WordPress. What a move can quietly lose is everything search engines and AI assistants already know about the site. Your rankings are attached to your URLs and to the metadata on each page, and if you lose either one, your traffic can drop for months even when the new site looks identical. So before you rebuild a single page, write down what has to survive. The graphic below is that list.

What has to survive the move
  1. 1URLsEvery page stays at the same address/pricing stays /pricing
  2. 2RedirectsA 301 for anything that moves, plus the old ones/plans 301 /pricing
  3. 3Titles and descriptionsCopied word for word, page by page<title> and meta description
  4. 4Social imagesWhat shows when a link is sharedog:image
  5. 5Canonical tagsEach page points at itselfrel="canonical"
  6. 6Structured dataArticle, FAQ and Organization markup"@type": "FAQPage"
  7. 7Sitemap and robots.txtRebuilt, then resubmitted to Google/sitemap.xml
  8. 8Image alt textTravels with every imagealt="Team dashboard"
  9. 9Analytics and pixelsEvery script back on the pages that had itGA4, Meta pixel, HubSpot
Search engines and AI assistants know your site by these. The design is the only part they never see.

Done right, a move to Astro usually helps SEO. Astro sends plain HTML with very little JavaScript, so pages load faster, and page speed is one of the things Google looks at. Lindy’s mobile Lighthouse score went from around 50 to over 90 the night it left Webflow. A month later every core SEO metric was the same or better, and some collections were getting 50% more organic traffic. Bolto’s Lighthouse scores went up more than 20 points, and three weeks in every SEO metric was holding steady. Pillar gained 21 points when it left Webflow.

URLs and redirects

The best thing you can do for your SEO is keep every page at its current URL. A page that keeps its URL needs no redirect and keeps everything it has earned. When you have to change a URL, add a permanent 301 redirect from the old URL. Google's site move guide says that 301 and other permanent redirects don't cause a loss in PageRank. Google's John Mueller says to keep redirects for at least a year.

Move any redirects you already have too, from your redirect plugin or .htaccess file. People have linked to those old URLs for years. WordPress URLs have a trailing slash, so set trailingSlash: 'always' in astro.config. That way /about/ stays /about/ and doesn't become a redirect. Copy the /wp-content/uploads/ folder into Astro's public folder, and images stay at their current URLs. That way image search traffic and hotlinks keep working.

Titles, descriptions and social images

Every page on your site has a title tag and a meta description. These are the two lines people see in Google, and they're usually set in your SEO plugin like Yoast or Rank Math. You'll also have an Open Graph title, description and image, which is what people see when someone shares a link in Slack, LinkedIn or iMessage. In Astro, all of this is set in a head component that every page uses, shown below. If you use Yoast, you can pull these from the yoast_head_json in the API response. Copy them over word for word, don't rewrite them as you migrate.

---
const { title, description, image, canonical = Astro.url.href } = Astro.props;
---
<title>{title}</title>
<meta name="description" content={description} />
<link rel="canonical" href={canonical} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={image} />

Canonicals, structured data, sitemap and robots.txt

WordPress adds a canonical tag to every page, and generates the sitemap automatically. After the migration, this is your job. Make sure the canonical tag on each page points to its own URL. Then run npx astro add sitemap and set site in astro.config. Astro will generate a sitemap-index.xml file on every build. If you have structured data on your WordPress site, like Article, FAQ or Organization JSON-LD, copy the script tags into the corresponding templates. This is what gets you rich results, and it helps AI assistants understand your content.

Copy your robots.txt file, and resubmit the sitemap in Google Search Console after the migration. WordPress also generates an RSS feed at /feed/. You can generate one with Astro's RSS package, and redirect /feed/ to it. This way, your subscribers and podcast apps will keep getting updates.

Alt text, analytics and tracking

Image alt text is easy to lose, because it's on each image instead of in page settings. Make sure to bring it across with the images.

It's worth listing every script that was on the old site, including Google Analytics, Tag Manager, ad pixels, chat, HubSpot tracking Then add each one back to the pages that had it. Plugins often add tracking without anyone remembering, so view the page source of the live site and search for script tags to find them all. Make sure the Search Console verification tag or file is still there, or the property stops being verified after the switch. Google's site move guide calls this out. After launch, send a test conversion and make sure it shows up in the analytics tool before trusting the numbers.

How to do it, step by step

1. Take stock of the site and its plugins

Before you move anything, you need to know what you're moving. Write down everything the site does and which plugin does it.

  • Every URL, from yoursite.com/sitemap.xml or the SEO plugin's sitemap
  • Post types and how many of each, including custom ones
  • The permalink structure under Settings, then Permalinks
  • Every active plugin and what visitors would lose without it
  • Every form and where its submissions go
  • Redirects, from the redirect plugin or .htaccess
  • Comments, search, memberships or a store, which need their own plan

2. Pull the content out

There are two ways to get your content out. The first is to export your content as a WXR file and then use a tool to convert it to Markdown. Astro's docs recommend wordpress-export-to-markdown, which converts your posts to Markdown files and downloads the images. The second is to use the REST API. It gives you clean JSON for your posts, pages and any custom post types, with Yoast metadata included. You can request 100 items at a time with per_page=100 and then loop through the pages.

Save each item as a separate file in your project. You can also fetch from the live API at build time, like this. That works well, and it means WordPress has to keep running. Either way, copy the whole /wp-content/uploads/ folder off the server.

---
const res = await fetch("https://yoursite.com/wp-json/wp/v2/posts?per_page=100&_embed");
const posts = await res.json();
---
{posts.map((post) => (
  <article>
    <h2 set:html={post.title.rendered} />
    <p>{post.yoast_head_json?.description}</p>
  </article>
))}

3. Rebuild the theme as Astro pages

A WordPress theme is a set of PHP templates. You'll be converting each of them into an Astro page or layout. single.php becomes src/pages/[slug].astro (or src/pages/blog/[slug].astro, depending on your permalink structure). archive.php becomes your blog index. header.php and footer.php become components. Copy your theme's compiled CSS into the project to get the pages looking right straight away, and trim it as you go.

The content of each post is HTML. You can drop it into the template with set:html. Shortcodes from plugins will show up as raw text in square brackets. Search your content for them and replace each with real markup. If you used a page builder like Elementor or Divi, the content is deeply nested HTML. For those pages, it's often easier to rebuild from a screenshot than to clean up the export.

4. Replace what plugins did

Go down the plugin list from step 1 and decide what replaces each one. Most of them turn out to need nothing at all.

  • SEO plugin. Titles, descriptions and schema go into the head component
  • Forms plugin. Use the HubSpot embed, a form service or your host's forms
  • Caching and image optimization. You don't need them, Astro is static and has image optimization built in
  • Security and backup plugins. You don't need them, there's no database or login page to attack
  • Redirect plugin. The rules go into astro.config or your host
  • Comments, search and stores. Each of these needs a hosted service or a decision to drop it

5. Match the URLs exactly

Recreate the permalink structure in the folder layout of src/pages, set trailingSlash to always, and add redirects for anything that can't match. Astro's redirect docs cover the syntax. Category, tag and author archive pages are URLs too. Rebuild the ones that get traffic and redirect the rest to the blog index. With a host adapter Astro sends real 301s. A plain static build writes a small page that redirects in the browser with no 301 status, so set redirects at the host in that case.

import { defineConfig } from 'astro/config';

export default defineConfig({
  site: 'https://www.yoursite.com',
  trailingSlash: 'always',
  redirects: {
    '/category/news/': '/blog/',
    '/feed/': '/rss.xml',
  },
});

6. Check everything, then switch

The most valuable check is to open every URL from your old sitemap on the new site. Each one should load or redirect. Then check that page titles and descriptions match on the top 20 pages by traffic. Count the pages and CMS items on both sides, and submit every form and find the test where it should land. Run Lighthouse on your homepage and heaviest pages.

Once all of that passes, point your domain's DNS at the new host. Keep the WordPress hosting plan for a few weeks in case you need to fetch something, then cancel. For the first month, watch for 404s in Search Console's Pages report.

Clean up the code so agents can work with it

A visual editor writes code for itself, not for whoever edits the site next. A WordPress theme with a page builder wraps every block in layers of generated containers and classes, and each plugin adds its own styles and scripts. Copy that markup into Astro and all of it comes along.

Rename classes and styles to say what they are, like pricing-card. Pull anything repeated into a component, so the nav, the footer and each card live in one file. Move colors, fonts and spacing into shared variables. Then Claude or ChatGPT can change one component and it updates everywhere, with no hunting through copies.

Or have Sherpa do the move for free

Do it yourself6 steps, all yours
  1. Take stock
  2. Pull content out
  3. Rebuild the theme
  4. Replace plugins
  5. Match URLs
  6. Check and switch
Sherpa does itFree
  1. Send your URL
  2. Preview in about 24 hours
  3. Review it together
  4. Switch DNS when ready
Your WordPress site stays live until you switch.

Sherpa has a free migration tool that does everything above, and you can run it yourself. You see the whole migration for free. Sign up, enter the URL of your WordPress site and Sherpa rebuilds it as an Astro site with clean class names and real components, from what's public today. You don't export or share a login. In as little as 24 hours you get a preview of the whole site. Pages keep their URLs, anything that moves is redirected, and titles, descriptions, social images, CMS content, forms and scripts are carried across. Sherpa's team walks through it with you against a checklist.

HackerRank moved to Sherpa from Webflow and WordPress, and small businesses on Sherpa have gone from paying a web developer for every edit to making changes themselves in a couple of minutes from ChatGPT. Your WordPress site stays live the whole time. When the preview has passed your review, the switch is a DNS change you make.

After the move you own the site forever. It's Astro code synced to GitHub that you can take anywhere. Sherpa hosts it and gives Claude or ChatGPT 150+ tools over MCP to run it. Anyone on your team can ask for a change, get a preview link, and a person presses publish.

Sherpa also keeps watching the things this guide is about. On the Growth plan its proactive improvements review the site every week, SEO included, and hand over fixes that take one click to ship. Clone your site to see it on Sherpa, or read how migration works.

Hear from people who moved their site to Sherpa

Teams that used to wait on a developer for every edit now run their sites from Claude or ChatGPT. Here’s what they said.

“It makes it obscenely easy to create and publish content. I’ve used WordPress and Squarespace and Webflow, and Sherpa is just leagues above.”
Arjun RamanChief of Staff, Bolto
“I rebuilt 14 pages, and I can do it while multitasking other projects. Didn’t need help from a web dev or designer.”
Lindy DropeHead of GTM, Lindy
“Your product is magic. I think this will democratize web updates to people in our company.”
Vivek RavisankarCEO, HackerRank

Common questions

Can Astro import a WordPress site?

Not in one step. Content comes out through the WXR export or the REST API and becomes files or API calls in Astro. The theme is rebuilt as Astro pages and each plugin is replaced or dropped.

Will moving from WordPress to Astro hurt SEO?

Not when every URL stays the same, trailing slash included, or has a 301 redirect, and each page keeps its title, description and canonical. Google says permanent redirects don't lose PageRank. Done right, it usually helps. A month after Lindy moved to Astro on Sherpa, every core SEO metric was the same or better and some collections had 50% more organic traffic.

Can you keep WordPress as the CMS and use Astro for the front end?

Yes. Astro can fetch posts from the WordPress REST API at build time. Editors keep the WordPress admin, and WordPress still has to be hosted, updated and secured.

How long does a WordPress to Astro migration take?

Getting the content out is the quick part. The rebuild depends on the theme, the number of templates and how many plugins need replacing. Sherpa has a full preview ready in as little as 24 hours. Lindy moved more than 2,000 pages in under 24 hours.

Do you own the code after Sherpa moves your site?

Yes. It’s Astro code synced to GitHub that you own forever and can take anywhere. Sherpa hosts it and gives Claude or ChatGPT the tools to run it.

Will the new site be faster?

Usually. Lindy went from around 50 to over 90 on mobile Lighthouse the night it moved. Bolto gained more than 20 points and Pillar gained 21.

Written by Ethan Kinnan, co-founder and CEO of Sherpa. Ethan has built over 100 websites on dozens of platforms.

Your website has places to go.
Let's get it moving.

Your next big website change could start with a conversation. See what Sherpa can do with your existing site.

Try Sherpa

Sources

Every link was checked on December 4, 2026.

See your own site on Sherpa.

  1. TodayPick a timePick a time
  2. Before the callWe copy your site over, freeWe copy it, free
  3. On the callYou take it for a spinTry it live
You'll talk to Ethan, Sherpa's founder.

Loading times…

Open the booking page in a new tab ↗