{"slug": "rebuilding-an-elementor-site-in-astro-what-i-keep-and-what-i-throw-away", "title": "Rebuilding an Elementor site in Astro (what I keep and what I throw away)", "summary": "A developer described a repeatable workflow for migrating Elementor-built WordPress sites to Astro by rebuilding rather than converting them: capturing full-page Playwright screenshots as the visual spec, extracting page content from Elementor's `_elementor_data` post meta via WP-CLI, and collapsing roughly 40 pages into about 8 reusable Astro section components fed by plain JSON. The process also rebuilds the Theme Builder header and footer as single components with a JSON-driven menu, then uses the coding agent to diff new screenshots against the originals and verify redirects for every old URL before deploying with `npx novence deploy`.", "body_md": "Half the WordPress sites I get asked to move are built in Elementor. The client wants \"the same site, just faster\". The problem is there is no clean export. Open the page HTML and every heading sits inside four nested divs with classes like `elementor-element-3f9a1c2`. You can't convert that into anything you'd want to maintain.\n\nSo I don't convert it. I rebuild it. But I rebuild it in a very specific order so it doesn't turn into a three week redesign nobody asked for.\n\nFirst job is a full page screenshot of every page at desktop and mobile width. My coding agent does this with Playwright from the sitemap:\n\n```\nnpx playwright screenshot --full-page --viewport-size=1440,900 https://client.com/about shots/about-desktop.png\nnpx playwright screenshot --full-page --viewport-size=390,844 https://client.com/about shots/about-mobile.png\n```\n\nThese screenshots are the spec. When the client says \"the old one had a blue bit there\" I can check in 10 seconds instead of arguing.\n\nElementor stores page content as JSON in post meta (`_elementor_data`), not in `post_content`. So the normal WordPress export gives you mostly empty pages. I grab it straight from the database or with WP-CLI:\n\n```\nwp post meta get 42 _elementor_data --format=json > raw/about.json\n```\n\nThen I ask the agent to walk the JSON and pull out only the things that matter: headings, paragraphs, buttons (text + link), images (url + alt) and the order they appear in. Everything else (padding, motion effects, custom CSS on a single widget) gets thrown away. The output is one plain markdown or JSON file per page.\n\nHere's the bit that saves the most time. Elementor sites look like 40 unique pages but they're usually about 8 section types repeated: hero, three column features, logo strip, testimonial, CTA band, FAQ, team grid, contact block.\n\nI give the agent the screenshots and the extracted content and ask it for a list of section types with which pages use them. Then I build each one once as an Astro component:\n\n```\n---\n// src/components/CtaBand.astro\nconst { heading, text, button } = Astro.props;\n---\n<section class=\"cta-band\">\n  <h2>{heading}</h2>\n  <p>{text}</p>\n  <a class=\"btn\" href={button.href}>{button.label}</a>\n</section>\n```\n\nPages become a stack of components fed by the extracted content. A 40 page site ends up being 8 components plus data, which is way easier to maintain then 40 hand built layouts.\n\nElementor sites collect stuff. Every rebuild I list these out and get a yes or no in writing:\n\nClients rarely miss any of it. What they notice is the page loading instantly on their phone.\n\nThe header and footer are usually built in Elementor's Theme Builder with mega menus and sticky effects. I rebuild them as one `Header.astro` and one `Footer.astro` with the menu coming from a small JSON file:\n\n```\n[\n  { \"label\": \"Services\", \"href\": \"/services\" },\n  { \"label\": \"About\", \"href\": \"/about\" },\n  { \"label\": \"Contact\", \"href\": \"/contact\" }\n]\n```\n\nThat file lives in `/data/menu.json` so on novence.ai the client can change menu labels themselves through the `/edit` page later without calling me.\n\nOnce the rebuild is done the agent screenshots the new preview at the same two widths and puts them side by side with the originals. I'm not looking for pixel perfect. I'm looking for missing sections, wrong button links, and images without alt text. It also checks every old URL from the sitemap has either a page or a line in `/_redirects`.\n\nThen it's `npx novence deploy`, client checks the preview, DNS goes over.\n\nRun Lighthouse on the old homepage and the new one before you hand over. Elementor pages tend to ship a pile of CSS and JS before the first image even loads, and the Astro version ships close to none, so the difference is easy to show. Same content, same look near enough, and the client can usually stop paying for Elementor Pro and whatever addon packs got bolted on over the years.\n\nThe trick is not trying to translate Elementor into Astro. Treat the old site as a reference and the content as the only thing worth keeping, and the rebuild goes a lot quicker then you'd expect.", "url": "https://wpnews.pro/news/rebuilding-an-elementor-site-in-astro-what-i-keep-and-what-i-throw-away", "canonical_source": "https://dev.to/lincchad/rebuilding-an-elementor-site-in-astro-what-i-keep-and-what-i-throw-away-2fdb", "published_at": "2026-12-03 00:10:57+00:00", "updated_at": "2026-12-03 00:16:55.278846+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["Elementor", "Astro", "WordPress", "Playwright", "WP-CLI", "Lighthouse", "novence.ai"], "also_reported_by": [], "takeaway": "Extracting Elementor content from the `_elementor_data` post meta (via `wp post meta get`) and collapsing a site into about 8 repeated section types as Astro components turns a 40-page rebuild into 8 components plus data.", "recommendation": {"advice": "Use Playwright full-page screenshots at desktop and mobile widths as the spec, then have the coding agent extract headings, text, buttons and images from `_elementor_data` and diff new screenshots against the originals for missing sections and broken links.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/rebuilding-an-elementor-site-in-astro-what-i-keep-and-what-i-throw-away", "markdown": "https://wpnews.pro/news/rebuilding-an-elementor-site-in-astro-what-i-keep-and-what-i-throw-away.md", "text": "https://wpnews.pro/news/rebuilding-an-elementor-site-in-astro-what-i-keep-and-what-i-throw-away.txt", "jsonld": "https://wpnews.pro/news/rebuilding-an-elementor-site-in-astro-what-i-keep-and-what-i-throw-away.jsonld"}}