SEO is one of those areas where “we’ve handled it” can mean anything from three meta tags to a complete implementation. Astro Rocket ships a complete one. Here is exactly what is included and where each piece lives.
What ships out of the box
The SEO layer covers six distinct concerns:
- Structured data (JSON-LD) — schema.org markup for the home page and every blog post
- Open Graph and Twitter Cards — social sharing metadata for every page
- Canonical URLs — preventing duplicate content penalties
- Sitemap — auto-generated and kept in sync with your pages
- Robots meta — per-page
noindex/nofollowcontrol - Verification tags — Google Search Console and Bing Webmaster
None of these require per-page setup. They are wired into the base layout and run automatically.
Structured data
Structured data is the part most themes skip. Astro Rocket outputs JSON-LD schema.org markup on every page.
Home page outputs three schemas:
WebSite— site name, URL, and search actionOrganization— your organisation name, logo, and contact detailsPerson— the site author
Blog posts output BlogPosting with full metadata:
{
"@type": "BlogPosting",
"headline": "Post title",
"description": "Post description",
"datePublished": "2026-03-17",
"dateModified": "2026-03-17",
"author": { "@type": "Person", "name": "Hans Martens" },
"image": "https://yoursite.com/og-image.jpg"
}
Structured data does not guarantee rich results in Google Search, but it is a prerequisite for them. Posts with BlogPosting markup are eligible for article rich results and knowledge panel entries. Pages without it are not.
All values are pulled from site.config.ts and the post frontmatter — nothing is hardcoded.
Open Graph and Twitter Cards
Every page generates a complete set of social metadata. For regular pages:
<meta property="og:title" content="Page Title" />
<meta property="og:description" content="Page description" />
<meta property="og:image" content="https://yoursite.com/og-default.jpg" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary_large_image" />
Blog posts use their cover image automatically:
<meta property="og:image" content="https://yoursite.com/blog/post-cover.jpg" />
<meta property="og:type" content="article" />
The default OG image for non-blog pages is configured in site.config.ts:
defaultOgImage: '/og-default.jpg',
Drop your 1200×630 image into /public/ and update the path. Every page that does not have its own image will use it.
Canonical URLs
Every page outputs a canonical URL tag pointing to the primary URL of that page:
<link rel="canonical" href="https://yoursite.com/blog/my-post" />
This runs automatically — no frontmatter field required. The canonical URL is always constructed from the production domain set in site.config.ts, so it stays correct regardless of staging environments or preview deployments.
Sitemap
The sitemap is generated by @astrojs/sitemap and includes every page that Astro renders at build time. Blog posts, landing pages, the contact page — all included automatically.
The sitemap URL is https://yoursite.com/sitemap-index.xml. Submit it to Google Search Console once after deployment and Google will pick up new posts as they are published.
To exclude a page from the sitemap, mark it with noindex — the integration respects the same pages you would not want indexed.
Robots meta
Pages can be excluded from search engine indexing via the SEO component’s props:
<SEO noindex nofollow />
This renders:
<meta name="robots" content="noindex, nofollow" />
Use this for admin pages, thank-you pages after form submissions, staging pages, or any content you want crawlers to skip. The base layout applies index, follow by default to all other pages.
Verification tags
Search console verification codes go in site.config.ts — no template editing, no separate file:
googleSiteVerification: 'your-code-here',
bingWebmasterVerification: 'your-code-here',
Set them and they render in <head> on every page. Leave them empty and nothing is rendered.
Configuring the site identity
All structured data pulls from the site object in site.config.ts. The fields that feed directly into SEO output:
export const site = {
name: 'Your Site Name',
url: 'https://yoursite.com',
description: 'Your site description for meta tags',
author: {
name: 'Your Name',
url: 'https://yoursite.com/about',
},
organization: {
name: 'Your Organisation',
url: 'https://yoursite.com',
logo: 'https://yoursite.com/logo.png',
},
};
Fill these in accurately. The url field in particular must be the production URL — it feeds into canonical tags, OG image URLs, and structured data. An incorrect URL there breaks your canonical implementation and can cause indexing issues.
Blog post SEO
Each blog post has two frontmatter fields that feed directly into SEO:
title— becomes the page<title>,og:title, andBlogPosting.headline. Keep it under 60 characters for clean display in search results.description— becomes the meta description andog:description. Keep it under 155 characters. Write it as a plain-language summary of the post — search engines use it as the snippet in results pages.
These two fields are the highest-leverage SEO work you will do for each post. Everything else is automatic.
Checking your SEO output
After deploying, verify with two tools:
- Google Rich Results Test — paste your URL and confirm structured data is parsed correctly
- Open Graph Debugger — verify social sharing metadata and force-refresh Facebook’s cache for updated images
Both are free and give you the ground truth on what search engines and social platforms actually see when they crawl your pages.