A familiar editing experience
We give your team reusable blocks for the content you publish most, from landing pages to case studies. The front end applies your design system to each block.
Publish in WordPress. Give your visitors a fast Astro website built around the content your team already knows how to manage.
Follow one homepage hero through four files. WordPress defines the editable fields and exposes them through its REST API. Astro validates the response at build time and renders the hero as HTML.
This example renders the hero without client-side JavaScript. The same approach works for the other blocks your team needs to publish.
block.json
{
"apiVersion": 3,
"name": "red-rocks/hero",
"title": "Homepage hero",
"editorScript": "file:./index.js",
"attributes": {
"heading": { "type": "string" },
"summary": { "type": "string" }
}
} page-api.php
<?php
add_action('rest_api_init', function () {
register_rest_field('page', 'hero', [
'get_callback' => function ($page) {
$post = get_post($page['id']);
if (!$post || $post->post_status !== 'publish' || $post->post_password !== '') {
return null;
}
foreach (parse_blocks($post->post_content) as $block) {
if ($block['blockName'] !== 'red-rocks/hero') continue;
return [
'heading' => $block['attrs']['heading'] ?? '',
'summary' => $block['attrs']['summary'] ?? '',
];
}
return null;
},
]);
}); homepage.ts
import { z } from "zod";
const url = new URL(
"/wp-json/wp/v2/pages?slug=home&_fields=hero",
import.meta.env.WORDPRESS_ORIGIN,
);
const response = await fetch(url);
if (!response.ok) throw new Error("WordPress request failed");
const hero = z.object({
heading: z.string().trim().min(1),
summary: z.string(),
});
const [home] = z.array(z.object({ hero })).parse(await response.json());
if (!home) throw new Error("Homepage not found");
export const homepageHero = home.hero; index.astro
---
import Layout from "../layouts/Layout.astro";
import { homepageHero } from "../content/homepage";
export const prerender = true;
const { heading, summary } = homepageHero;
---
<Layout title={heading}>
<section aria-labelledby="homepage-heading">
<h1 id="homepage-heading">{heading}</h1>
<p>{summary}</p>
</section>
</Layout> We give your team reusable blocks for the content you publish most, from landing pages to case studies. The front end applies your design system to each block.
Astro can generate HTML before visitors arrive, resize images for different screens, and load JavaScript where an interaction needs it.
We map URLs, preserve useful content, and test redirects, forms, and analytics. Your team gets a handoff that covers previews, publishing, and routine updates.
Decide what your editors, plugins, and publishing process need before choosing a setup.
Yes. We set up the blocks and patterns your team needs, then show editors how to build pages and preview changes before publishing.
A publish event can trigger an Astro rebuild for static pages. If a page needs current data on every request, we can render it on demand. We choose the approach based on how often the content changes.
Editorial and back-office plugins may still work in WordPress. Plugins that render forms, search, or checkout in a theme need a front-end integration. We review those dependencies before scoping the migration.
A WordPress block theme can be a better fit if your team depends heavily on theme plugins or wants one system to host and maintain. We can compare the two approaches using your site and publishing requirements.