# Make your Astro site rank well

> Set titles, descriptions, canonicals, sitemap, robots.txt and structured data on your Astro site, and connect it to Google Search Console.

Source: https://viralistic.nl/help/astro/astro-seo

A Viralistic Astro site already has solid technical SEO built in: static HTML, canonical URLs, a sitemap, `robots.txt` and structured data. What it cannot do on its own is write good titles, link pages together or tell Google it exists. This article is for site owners and marketers who want every page to be found. You will learn which fields to fill in, what the site handles for you and how to set up Google Search Console.

## Titles and descriptions

Every page has a `title` and a `description` in its frontmatter. The title is the main heading on the page and, by default, also the title in search results. An optional `seo` block lets you write a different version for Google:

```yaml
title: Managed website hosting in Amsterdam, with one person to call.
description: Managed hosting by Viralistic. Your website kept live, fast and secure.
seo:
  title: "Managed Website Hosting Amsterdam | Viralistic"
  description: "Managed website hosting in Amsterdam. Your site kept live, fast and secure, with one partner for domain, DNS, SSL and email."
```

Guidelines that work:

- Make every title and description unique across the site.
- Put the main topic first in the title and the brand at the end. Around 50 to 60 characters fits in most results.
- Write the description as a reason to click, in roughly 150 to 160 characters.
- Use the words your customers search for, not internal jargon.

## Headings

The layout shows the page title as the only `h1`. In the body, start sections with `##` and sub-sections with `###`. Keep the order logical and make headings descriptive: "Pricing for small teams" tells both readers and search engines more than "More info".

## Canonical URLs and noindex

The site builds a canonical URL for every page from the site address and the page path, so search engines see one official address per page. Viralistic sites use URLs without a trailing slash, and links within the site should follow the same pattern.

Two `seo` options are for special cases only:

- `canonical`: point to another URL when two pages carry the same content.
- `noindex: true`: keep a page out of search results, for example a thank-you page or a placeholder.

> **Note:** A page with `noindex` should also be left out of the sitemap. The sitemap filter lives in `src/lib/integration.ts`.

## Sitemap and robots.txt

Both are generated on every build by the site integration:

- `@astrojs/sitemap` writes `sitemap-index.xml`, listing every page.
- `astro-robots-txt` writes `robots.txt` and points crawlers to the sitemap.

After a deploy, open `/sitemap-index.xml` and `/robots.txt` on your live domain to check them.

## Structured data

The base layout adds a JSON-LD graph to every page describing the organisation, the website, the page itself and its breadcrumbs. The company facts (name, address, phone, social profiles) live in one file, `src/lib/schema.ts`. Keep them identical to your Google Business Profile and other listings.

Specific page types can add more, such as an `Article` for blog posts:

```json
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "Your article title",
  "datePublished": "2026-10-07",
  "author": { "@type": "Person", "name": "Your Name" }
}
```

Test pages with Google's Rich Results Test and the Schema Markup Validator after changes.

## Internal links and images

- Link related pages to each other with descriptive link text. "See our [hosting plans](https://viralistic.nl/webdesign/hosting)" beats "click here".
- Make sure every page is linked from at least one other page. Pages nobody links to are hard to find for search engines too.
- Give every image meaningful alt text and a descriptive file name. See [Images and media](https://viralistic.nl/help/astro/images-and-media).
- Keep pages fast. Speed affects both rankings and conversions. See [Score high on Lighthouse](https://viralistic.nl/help/astro/performance).

## Set up Google Search Console

1. Go to Google Search Console and add a **Domain** property for your domain.
2. Verify ownership with the TXT record Google gives you, added at your DNS provider.
3. Open **Sitemaps** and submit `https://yourdomain.com/sitemap-index.xml`.
4. Use URL inspection to request indexing for important new pages.
5. Check the indexing and Core Web Vitals reports once a month.

> **Tip:** Verification can take a while to succeed after you add the DNS record. If it fails, wait an hour and try again before changing anything.

## Next steps

- [Get cited by AI search](https://viralistic.nl/help/astro/ai-search)
- [Score high on Lighthouse](https://viralistic.nl/help/astro/performance)
- [Keep your rankings when you relaunch](https://viralistic.nl/help/astro/redirects)
- [Connect your domain](https://viralistic.nl/help/astro/connect-your-domain)
