Skip to content

Basics / 09

SEO & AEO

Meta tags, structured data, sitemaps, RSS, and llms.txt are built in. Here's what's included and what to fill in.

Browse the docs

Every page gets search and social meta tags, linked structured data, and a place in the sitemap automatically. Your job is to write good titles and descriptions and fill in a few settings.

What’s included

Feature Where
Title, description, canonical, Open Graph, Twitter cards Every page, via BaseLayout
Structured data (JSON-LD) WebSite, Person, WebPage, breadcrumbs, BlogPosting, plus ProfessionalService and FAQ when you fill in their settings
Sitemap with last-modified dates from Git /sitemap-index.xml
robots.txt /robots.txt
RSS /rss.xml
llms.txt for AI assistants: a summary, your pages, and every post /llms.txt
Every post in full for AI assistants /llms-full.txt
Schema map /schemamap.xml and /schema/*.json
Social card images public/og.png, generated on build

AEO (answer-engine optimization) means making your site easy for AI assistants to understand and cite. llms.txt, FAQ structured data, and the aeo settings handle that.

Settings

In src/config/integrations.ts:

  • seo.title and seo.description: defaults for pages that don’t set their own
  • seo.sameAs: your social profiles, used in structured data
  • seo.twitterHandle, seo.ogImage, and seo.ogImageAlt (the social image’s alt text)
  • seo.verification.google and seo.verification.bing: the codes from Google Search Console and Bing Webmaster Tools (just the content value of their meta tag)
  • aeo.summary, aeo.knowsAbout, aeo.servicesOffered: what llms.txt says about you. Leave servicesOffered empty ([]) on a site that doesn’t sell services, and the ProfessionalService data is left out
  • aeo.faq: questions and answers, shown on the contact page as Common questions with FAQ structured data on that page. Leave it empty to hide them
  • aeo.llmsNotes: anything else AI assistants should know, added to llms.txt
  • aeo.allowAiCrawlers: set false to block nine AI training crawlers, including GPTBot, ClaudeBot, Google-Extended, and PerplexityBot. Search engines are unaffected

Analytics

Also in integrations.ts:

analytics: {
  googleTagId: "G-XXXXXXX", // Google Analytics, or GTM-XXXXXXX for Tag Manager
  plausibleDomain: "", // used when there's no Google tag
},

Scripts load only when the page’s hostname matches identity.url, so local builds and preview deploys aren’t counted. If you turn analytics on, say so in src/pages/privacy.md.

FAQ structured data

Google only shows FAQ results for questions that are visible on the page, so the FAQ data follows the questions. The contact page passes faq to BaseLayout, which adds it there:

<BaseLayout pageType="contact" faq={siteConfig.aeo.faq.length > 0}>

To show the questions somewhere else, for example in an FAQ section on the home page, move the faq prop to that page, remove the Common questions section from src/pages/contact.astro, and move faq: true to that page’s row in src/pages/schema/pages.json.ts.

Per-page titles

Built-in pages take their title and description from src/config/pages.ts. Blog posts use their frontmatter, with optional seo overrides. A post with seo.noindex: true is also left out of the sitemap, llms.txt, llms-full.txt, and the schema endpoints. Aim for titles under 65 characters and descriptions between 70 and 160.

The build check

After every build, scripts/check-seo.mjs scans the output and warns about missing or overlong titles and descriptions, duplicate titles, pages with zero or several h1s, and images without alt text.

Before launch

  1. Set site in astro.config.mjs to your real domain.
  2. Run npm run build and fix any warnings.
  3. Check /sitemap-index.xml, /robots.txt, /rss.xml, /llms.txt, and /llms-full.txt on the live site.
  4. Add your Google Search Console and Bing Webmaster Tools verification codes to seo.verification, deploy, then submit the sitemap in both.
  5. Optional: add an INDEXNOW_KEY to your host’s environment so Bing and Yandex hear about changes immediately.