Does not cover locale routing mechanics beyond hreflang tag generation (astro-i18n), Content Layer schema design (astro-content), or image-specific optimization like <Image />/<Picture /> (astro-assets) — those are separate skills.
Astro SEO
Complete SEO strategy for Astro 7 sites — zero JS by default makes Astro naturally SEO-friendly.
Agent Workflow (MANDATORY)
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
- fuse-ai-pilot:explore-codebase - Analyze existing layouts, head components, and metadata
- fuse-ai-pilot:research-expert - Verify latest SEO best practices via Context7/Exa
- mcp__context7__query-docs - Check Astro 7 sitemap/RSS integration docs
After implementation, run fuse-ai-pilot:sniper for validation.
Overview
When to Use
- Adding meta tags and Open Graph to any Astro page
- Generating JSON-LD structured data for rich snippets
- Setting up @astrojs/sitemap for search indexing
- Configuring RSS feeds with @astrojs/rss
- Creating robots.txt and canonical URL patterns
- Adding hreflang for multilingual SEO
- Measuring and improving Core Web Vitals
Why Astro for SEO
| Feature |
Benefit |
| Zero JS by default |
Pure HTML for crawlers, instant indexing |
| Static output |
Sub-second TTFB, top Core Web Vitals |
Astro.site |
Canonical URL construction built-in |
| Islands Architecture |
Only hydrate interactive parts |
Core Concepts
Head Component Pattern
Create a reusable <SEO /> or <Head /> component accepting title, description, og, canonical props. Place in all layouts. Use Astro.site for absolute URL construction.
Canonical URLs
Always construct canonicals with Astro.site:
const canonical = new URL(Astro.url.pathname, Astro.site);
Structured Data
Inject JSON-LD via <script type="application/ld+json" set:html={JSON.stringify(schema)} />. Use set:html to avoid XSS — never template string interpolation.
Reference Guide
Concepts
| Topic |
Reference |
When to Consult |
| Meta Tags & OG |
meta-tags.md |
Setting up head metadata |
| JSON-LD |
structured-data.md |
Rich snippets, schema.org |
| Sitemap & RSS |
sitemap-rss.md |
Search indexing, feeds |
| Canonical & hreflang |
canonical-hreflang.md |
Duplicate content, i18n |
| Core Web Vitals |
core-web-vitals.md |
LCP, CLS, FID optimization |
Templates
| Template |
When to Use |
| seo-head.md |
Reusable SEO head component |
| json-ld.md |
JSON-LD BlogPosting, WebSite schemas |
Best Practices
- One Head component - Centralize all meta in a reusable component
- Absolute URLs - Use
Astro.site for og:image and canonicals
set:html for JSON-LD - Prevents XSS vulnerabilities
- sitemap + robots.txt - Always configure both for crawlability
- hreflang on all locales - Include x-default for language variants
1---2name: astro-seo3description: Use when optimizing SEO for an Astro site — meta tags, Open Graph, JSON-LD structured data, sitemap/RSS, canonical URLs, hreflang, Core Web Vitals.4versions:5 astro: "7"6user-invocable: true7references: references/meta-tags.md, references/structured-data.md, references/sitemap-rss.md, references/canonical-hreflang.md, references/core-web-vitals.md, references/templates/seo-head.md, references/templates/json-ld.md8related-skills: astro-7, astro-content, astro-assets, astro-i18n9metadata:10 source: https://skillmd.com/skills/fusengine/astro-seo11---1213<objective>14Implements SEO for Astro 7 sites: meta tags, Open Graph, and Twitter Cards via a reusable `<SEO />`/`<Head />` component; JSON-LD structured data injected with `set:html` (never string interpolation, to avoid XSS); `@astrojs/sitemap` and `@astrojs/rss` setup; robots.txt and canonical URLs built with `Astro.site`; hreflang for multilingual SEO; and Core Web Vitals optimization leveraging Astro's zero-JS-by-default output.1516Does not cover locale routing mechanics beyond hreflang tag generation (astro-i18n), Content Layer schema design (astro-content), or image-specific optimization like `<Image />`/`<Picture />` (astro-assets) — those are separate skills.17</objective>1819# Astro SEO2021Complete SEO strategy for Astro 7 sites — zero JS by default makes Astro naturally SEO-friendly.2223## Agent Workflow (MANDATORY)2425Before ANY implementation, spawn 3 agents in parallel, one `Agent` call each with a `name`:26271. **fuse-ai-pilot:explore-codebase** - Analyze existing layouts, head components, and metadata282. **fuse-ai-pilot:research-expert** - Verify latest SEO best practices via Context7/Exa293. **mcp__context7__query-docs** - Check Astro 7 sitemap/RSS integration docs3031After implementation, run **fuse-ai-pilot:sniper** for validation.3233---3435## Overview3637### When to Use3839- Adding meta tags and Open Graph to any Astro page40- Generating JSON-LD structured data for rich snippets41- Setting up @astrojs/sitemap for search indexing42- Configuring RSS feeds with @astrojs/rss43- Creating robots.txt and canonical URL patterns44- Adding hreflang for multilingual SEO45- Measuring and improving Core Web Vitals4647### Why Astro for SEO4849| Feature | Benefit |50|---------|---------|51| Zero JS by default | Pure HTML for crawlers, instant indexing |52| Static output | Sub-second TTFB, top Core Web Vitals |53| `Astro.site` | Canonical URL construction built-in |54| Islands Architecture | Only hydrate interactive parts |5556---5758## Core Concepts5960### Head Component Pattern6162Create a reusable `<SEO />` or `<Head />` component accepting `title`, `description`, `og`, `canonical` props. Place in all layouts. Use `Astro.site` for absolute URL construction.6364### Canonical URLs6566Always construct canonicals with `Astro.site`:67```ts68const canonical = new URL(Astro.url.pathname, Astro.site);69```7071### Structured Data7273Inject JSON-LD via `<script type="application/ld+json" set:html={JSON.stringify(schema)} />`. Use `set:html` to avoid XSS — never template string interpolation.7475---7677## Reference Guide7879### Concepts8081| Topic | Reference | When to Consult |82|-------|-----------|-----------------|83| **Meta Tags & OG** | [meta-tags.md](references/meta-tags.md) | Setting up head metadata |84| **JSON-LD** | [structured-data.md](references/structured-data.md) | Rich snippets, schema.org |85| **Sitemap & RSS** | [sitemap-rss.md](references/sitemap-rss.md) | Search indexing, feeds |86| **Canonical & hreflang** | [canonical-hreflang.md](references/canonical-hreflang.md) | Duplicate content, i18n |87| **Core Web Vitals** | [core-web-vitals.md](references/core-web-vitals.md) | LCP, CLS, FID optimization |8889### Templates9091| Template | When to Use |92|----------|-------------|93| [seo-head.md](references/templates/seo-head.md) | Reusable SEO head component |94| [json-ld.md](references/templates/json-ld.md) | JSON-LD BlogPosting, WebSite schemas |9596---9798## Best Practices991001. **One Head component** - Centralize all meta in a reusable component1012. **Absolute URLs** - Use `Astro.site` for og:image and canonicals1023. **`set:html` for JSON-LD** - Prevents XSS vulnerabilities1034. **sitemap + robots.txt** - Always configure both for crawlability1045. **hreflang on all locales** - Include x-default for language variants