How to write SEO articles for Astro blog posts comes down to a sequence of decisions: pick a query the site nearly wins in Search Console, read what ranks, write a brief, draft a Markdown post in a content collection, trace each claim to a primary page, review it in a pull request, then publish and refresh. No process guarantees rankings.
Your Astro blog builds and deploys from Git, and the head tags and sitemap are done. Nobody has defined how to write SEO articles for an Astro blog, though: which query a post targets, what the file must contain, and what gets checked before it merges.
You’ll leave with a repeatable procedure, a front-matter schema that works as an editorial checklist, and a pull request review routine.
Key Takeaways
- A content collection schema fails the build on a missing required field but can’t judge whether a claim is true or a title useful.
- Google builds title links and snippets from page content and may rewrite yours, so write for the reader.
- A citation shows where a claim came from, not that the source is right.
- A draft filter on the post route and the RSS feed keeps
draft: trueposts off the site and out of the feed.
How to write SEO articles for Astro blog posts, step by step
Writing SEO articles for an Astro blog takes seven steps in a fixed order, and each step ends with a file or record the next step reads.
- Choose the query. Open the Search Console Performance report and pick a query where the site sits near the bottom of page two. A person makes the call, and the output is one query, written down.
- Read what ranks. Open the top results and note what the searcher wants from them. Skipping this note on intent is the usual reason a post answers a different question than the one searched.
- Write a brief. Set the angle, the sections, and the question each section answers. Google Search Central says its ranking systems “are designed to prioritize helpful, reliable information that’s created to benefit people, not to gain search engine rankings, in the top Search results.” Use that as the quality bar for steps 2 and 3.
- Draft the post. Create a Markdown file in the content collection with
draft: true. - Source the claims. Trace every fact to a primary page before it stays in the draft, and record each pair in a claim-to-source list.
- Review the branch. A second person reads the diff in a pull request and checks claims against the list.
- Publish. Flip
drafttofalse, merge, and let the deploy run. The merge commit and the live URL are the record.
Each post gets its own branch, merged only after review:
git switch -c post/astro-seo-articles
git add src/content/blog/astro-seo-articles.md
git commit -m "Add post: how to write SEO articles for Astro"
git push -u origin post/astro-seo-articles
The reviewer in step 6 works in the pull request. Nothing reaches production until it merges.
Refreshing a published post has its own section below. Readers comparing publishing and review routes can check the shortlist of AI SEO writing tools for developer blogs.
How do you pick a query from Search Console?
You pick a query from Search Console by listing queries with their average position and keeping the ones that sit at roughly positions 11-30 with meaningful impressions.
- Open the report. Go to Performance, then Search results. Google’s help page for the Performance report lists “Average position” as a metric, so click its tile to show it next to impressions.
- Sort the Queries table. Open the Queries tab and sort by impressions, descending. A range of a few months gives more stable numbers than a few days.
- Shortlist candidates. Keep rows with an average position of about 11-30 and enough impressions to matter.
If a query shows 1,200 impressions at position 14.2, click it and open the Pages tab. Because the position is an average, check which page ranks and whether it’s the one you’d expect. 4. Read the results. Search the query and open the top pages. Name the intent (a how-to, a definition, a comparison), then list what they cover that your page doesn’t: steps, examples, a table, a source. 5. Write the brief. Fill in one paragraph before drafting.
Brief template: Query: the exact phrase and its position and impressions. Reader: who types it and what they already know. Intent: the one job the page must do.
Sections: one H2 per question the ranking pages answer, plus the gap you found. Sources to read: the primary pages each claim will trace to.
Sitting near page two doesn’t mean a rewrite will reach page one. The ranking pages may already answer the query better, and the position can move for reasons a new post can’t change.
How do you set up the file when you write SEO articles for an Astro blog?
An Astro post is set up for SEO with three pieces: a Markdown file in a content collection, a front-matter schema that validates it, and a layout that prints that front matter into the page. Astro’s content collections docs say that to define collections, you create a src/content.config.ts file.
- Define the schema. Add a
blogcollection that loads Markdown withglob()and validates front matter with Zod:
import { defineCollection, z } from 'astro:content';
import { glob } from 'astro/loaders';
const blog = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/blog' }),
schema: z.object({
title: z.string(),
description: z.string(),
pubDate: z.coerce.date(),
tags: z.array(z.string()),
draft: z.boolean().default(false),
}),
});
export const collections = { blog };
A schema can require fields, types and defaults. A post with no description fails astro build with a validation error, and draft becomes false when a writer omits it.
Usefulness, accuracy and intent are left to a reviewer, who checks them on the pull request.
- Create the post file. Save
src/content/blog/astro-seo-articles.mdwithtitle,description,pubDateandtagsin the front matter.
The file name becomes the entry id, and the route uses that id as the URL. Pick a short, keyword-led name before the first publish, because renaming later changes the URL.
- Generate the route. Astro’s docs say content collections live outside
src/pages/, so no pages are generated for them by default and you create a dynamic route yourself. Insrc/pages/blog/[...slug].astro, build the paths from the collection:
export async function getStaticPaths() {
const posts = await getCollection('blog', ({ data }) => !data.draft);
return posts.map((post) => ({ params: { slug: post.id }, props: { post } }));
}
The docs describe the filter callback as a way to query by an entry’s id or data properties. Here it drops every draft: true post, so a draft never gets a URL.
- Print the front matter in the layout. The layout puts
data.titlein the<title>tag and the page’s single<h1>, and putsdata.descriptionin the meta description. Because the title is the only H1, body headings start at H2.
The layout also builds a canonical link from Astro.url.pathname and Astro.site, which means site must be set in astro.config.mjs.
This layout adds no Open Graph tags or structured data, so add those separately if your site needs them.
Does Google use your title and meta description as written?
Google doesn’t always use your title and meta description as written: it generates title links and snippets automatically from the title element, headings and other page text, and may use your meta description when it describes the page better.
Google Search Central’s documentation on title links says that “Google’s generation of title links on the Google Search results page is completely automated and takes into account both the content of a page and references to it that appear on the web.”
The page names the <title> element as one source and also lists “Heading elements, such as <h1> elements”. Your <h1> is therefore a candidate for the title link too, and Google can show something other than what you wrote in title.
Snippets work the same way. The snippet and meta description documentation says Google sometimes uses the meta description when it is “likely to give users a more accurate description of the page than content taken directly from the page.”
The same page says the snippet is “truncated in Google Search results as needed”, so no fixed length applies to what appears.
In your Astro front matter, that leads to four habits:
- Give every post a descriptive title that no other page on your site shares.
- Write a description that summarizes that one page.
- Make the headings (
##and###) mirror the structure of the content, so the page text supports the title and snippet if Google draws from it. - Check the title and description against what the post says before you merge.
Put the query’s main phrase in the title in natural wording. If the query is “astro content collection schema”, a title such as “How to validate Astro posts with a content collection schema” reads normally and contains the phrase.
Write the description as one plain sentence that answers the query. If the query asks what a schema checks, say what it checks.
Google may still replace either field. The body text must answer the query as well, because that’s the text Google can fall back on.
How do you source every claim before you write it?
You source every claim before you write it by keeping a claim ledger in the pull request description, so no fact enters the draft until it has a primary page behind it.
- List each claim. Add one line per factual sentence you plan to write. Leave out your own procedure and advice, which need no source.
- Add the primary URL. Use Google Search Central for search behavior and the Astro docs for file mechanics. A blog post that summarizes either page is a lead to follow, not a source.
- Paste the supporting passage. Copy the sentence from the page that backs the claim. If you can’t find one, cut the fact.
- Have the reviewer open every URL. The reviewer compares each passage with your wording. The usual mistake is a claim that says more than the passage does.
A cited page can be outdated or wrong, so the reviewer still judges the source itself.
BirchSeek is one way to enforce the rule. Its post on why articles cite their sources says “BirchSeek will not publish a factual claim without a source you can open,” and that before a draft reaches you it “tries to find that support on the live page.”
A person approves the draft before anything ships. You can start setup and try it on one post.
How do you review and refresh SEO articles for an Astro blog?
An Astro SEO article gets reviewed as a pull request, where a reviewer confirms the file builds, is sourced and is ready to ship, and the same routine reopens the post when something changes.
Where the team allows it, the reviewer should be a different person from the author, because authors read past their own gaps. A reviewer checks these seven things before merging:
- The build passes with the schema. CI runs
astro build, so a missing required front-matter field fails the check instead of reaching production. draftisfalse. A post merged withdraft: truedeploys without appearing.- Every claim has a primary source in the ledger. Open the ledger in the pull request description and follow the links for the claims that carry the argument.
- Title and description are specific and unique on the site. Search the repository for the same wording in other posts.
- Headings answer the questions a reader asks. Each H2 should read as a question someone would type or wonder about.
- The slug is short and correct. It becomes the URL, so fix it before merging.
- Links resolve and use descriptive anchor text. Open each one, and replace anchors like “here” with words that say what the page covers.
If your schema requires description and a new post omits it, the CI build fails on the pull request. The reviewer sends it back, the author adds one specific sentence, and the check turns green before anyone merges.
When to reopen a published post
- A cited source page changes. If a Google Search Central or Astro documentation page you cited is edited, recheck the sentences that rest on it.
- Search Console shows the query slipping, or impressions without clicks. Compare the post against what ranks now.
- A fact has aged. Any version, date or price in the post needs a fresh look.
A refresh goes through a new branch and the same checklist. Consider adding an optional updatedDate field to the schema and setting it when the refresh merges.
Keep the slug stable so existing links and indexed URLs keep working.
How do new posts reach the sitemap, RSS feed and existing pages?
A new post reaches the sitemap and RSS feed through Astro’s integrations when the site builds, and the writer adds the internal links by hand.
The @astrojs/sitemap docs say the integration generates a sitemap based on your pages when you build your Astro project. It requires a site URL, which you set with the site property in astro.config.*. A new post needs no sitemap edit.
Google’s sitemap documentation adds that using a sitemap doesn’t guarantee that every item in it will be crawled and indexed, so treat it as a discovery aid.
The Astro RSS recipe builds the feed by using the getCollection() function to retrieve the list of items for your feed. In src/pages/rss.xml.js, apply the same draft filter as the post page route, so a post with draft: true stays out of the feed as well as off the site.
The build can’t add internal links for you. Do these in the same pull request as the post:
- Link out from the new post. Add links to two or three relevant existing pages, such as a related guide or a hub page.
- Link in from existing pages. Edit older posts and hub pages that cover nearby topics so each points to the new post. A post nothing links to is hard for readers to find.
- Write descriptive anchor text. Google’s SEO Starter Guide says anchor text tells users and Google something about the page you’re linking to. Anchors like “this post” tell them nothing.
- Keep one URL per post. Link to the one slug URL everywhere.
A reviewer can check the result in the diff: the new file, the edited older files, and no draft in the feed output.
Frequently asked questions
Does Google penalize AI-written articles on an Astro blog?
Google’s guidance on AI-generated content judges the content, not the tool that wrote it, and its current guidance page says “Appropriate use of AI or automation is not against our guidelines.” Google’s spam policies define scaled content abuse as “many pages are generated for the primary purpose of manipulating search rankings and not helping users.” A single post that a person reviewed and sourced is a different case, though no post is guaranteed to rank.
Do I need @astrojs/sitemap and an RSS feed for a new post to rank?
They help discovery by listing the new URL for crawlers and readers, and no article can promise a ranking. Links from existing posts give crawlers another path to the page.
How often should I update a published Astro post?
Update it when something changes, not on a fixed calendar. Reopen the post when a source page changes, when a fact in it has aged, or when Search Console shows the query’s average position slipping, and send the update through the same pull request review as a new post.
Does a citation prove a claim is correct?
No. A reviewer still opens the page, confirms it says what the draft says, and judges whether it’s the best source available. A primary page beats a summary of it.
What should you do this week, this month and this quarter?
This week, write one brief; this month, tighten the schema and pull request template; this quarter, refresh the posts that have aged.
- This week: pull the Search Console queries at positions 11-30 and write one brief for the strongest of them.
- This month: add the required fields and a
draftflag to the collection schema, and adopt the reviewer checklist in your pull request template. - This quarter: review published posts against their sources and Search Console data, and refresh the ones that have aged.
Once the schema and checklist are in place, a file missing a required field fails the build. The reviewer can then spend their time on sources and intent instead of formatting.
Sources
Content collections | Docs | Astro · Control your snippets in search results | Google Search… · Creating helpful, reliable, people-first content | Google… · Performance report (Search results) - Search Console Help · Influencing your title links in Google Search | Google… · Why every BirchSeek article cites its sources · @astrojs/sitemap | Astro Docs · Learn about sitemaps | Google Search Central. Every other source is linked where the article cites it.