# SEO & AI Visibility

## SEO & AI Visibility

**Files:** `src/config/config.toml`, `src/i18n/<language>.json`, page frontmatter · **Skill level:** Beginner

Lotline handles the technical SEO for you: page titles and descriptions, canonical links, a sitemap, `robots.txt`, structured data for your agency and each listing, social preview cards, RSS, and files for AI assistants. Your part is to set your domain and agency details, and to write good titles and descriptions.

### First, Set Your Domain
```toml
[site]
  baseUrl = "https://www.your-domain.com"   # ships as "https://example.com"
```

Canonical links, the sitemap, `robots.txt`, RSS feeds, `llms.txt`, structured data and social preview URLs all use it. Until you change it, `npm run build` prints a yellow `[site]` warning. Don't deploy while you see it, or every page will point search engines at `example.com`.

A `SITE_URL` environment variable on the build takes priority over `baseUrl`. On Vercel, the included `vercel.sh` sets one for you.

### Agency Details For Search
Search engines and map results read your agency from `[business]` in `config.toml`: the name, phone, email, address, opening hours and type. Set them once there (see [Business Info](/lotline/customization/business-info/)), and every page and the structured data use them.

```toml
[business]
  type       = "RealEstateAgent" # RealEstateAgent | LocalBusiness | ProfessionalService
  priceRange = "$$"

  [business.address]
    show = true # false: street and postal code are hidden everywhere

  [business.geo] # optional, helps map results. Leave empty if unsure
    latitude  = ""
    longitude = ""
```

`RealEstateAgent` is the schema.org type for an agency or brokerage, and it fits most Lotline sites.

### Titles And Descriptions
Every page and entry accepts these frontmatter fields:

```yaml
---
title: "Five-bedroom villa with city views"           # shown on the page
metaTitle: "Five-bedroom villa for sale in Elm Hill"   # search result title (optional)
description: "A five-bedroom villa finished in 2021..." # page summary
metaDescription: "Five bedrooms, a pool patio and a clear view over the city..." # 140 to 160 characters (optional)
image: "/images/lotline/properties/elm-hill-modern-villa/cover.jpg" # social preview image (optional)
canonical: ""                                          # only if the page copies another URL
robots: ""                                             # for example "noindex, follow"
keywords: ["villa for sale Elm Hill"]
---
```

Titles get your tagline added: "Five-bedroom villa for sale in Elm Hill - Your tagline". The tagline, the default description and the default keywords come from each language's file:

```jsonc
// src/i18n/en.json
"seo": {
  "keywords": "real estate agency, homes for sale, homes for rent, ...",
  "siteDescription": "Lotline is an Astro and Tailwind CSS theme for real estate agencies ...",
  "tagline": "Real Estate Agency Astro & Tailwind CSS Theme"
}
```

These ship describing the theme, so rewrite them for your agency in every language before launch. A value in `[site]` (`description`, `tagline`) or `[seo] keywords` in `config.toml` replaces them in every language, which suits a site with one language. `taglineSeparator` changes the ` - ` between title and tagline, and `disableTagline: true` turns the tagline off for one page. `[seo] author` is empty by default, which uses your agency name.

`[seo] robots` ships with `max-snippet:-1, max-image-preview:large`, so search results and AI answers can quote your pages and show their photos in full.

### Structured Data (JSON-LD)
```toml
[seo.schema]
  enable  = true # JSON-LD on every page
  faqPage = true # FAQPage markup on /faq/
```

Lotline builds it from your content, so it always matches what visitors see:

| Page | Structured data |
| --- | --- |
| Every page | Your agency (type, name, address, phone, hours, price range, the neighborhoods you cover) and the website |
| Property pages | A `RealEstateListing` with its price, currency, floor area and photo |
| `/properties/` | A list of the listings |
| Service pages | A `Service` with your agency as provider and the areas where it's offered |
| Neighborhood pages | The neighborhood as an area you serve |
| Agent pages | A `Person` with name, role, phone, email and languages, working for your agency |
| `/faq/` | `FAQPage` with every question |
| Job pages | `JobPosting` with pay, type and dates |
| Posts | `BlogPosting` with the author |
| Inner pages | Breadcrumbs |

<Aside type="note" title="No review stars in the markup">
  Lotline never marks up reviews or ratings. Reviews hosted on your own site
  count as self-serving for Google, which doesn't show stars for them. Your
  reviews and rating still show on the page.
</Aside>

Keep the data true. Job postings are for real openings only, and the sample listings, agents and prices have to be replaced before launch. After launch, test a property page with Google's [Rich Results Test](https://search.google.com/test/rich-results).

### Social Preview Cards
```toml
[opengraph]
  image          = "/images/og-image.jpg" # fallback card, public/images/og-image.jpg
  generateImages = true # a 1200×630 card for every page without its own image
  twitter        = ""   # your X (Twitter) handle
```

- A page with its own `image`, such as a listing with its cover photo, uses that photo.
- Every other page gets a card drawn during `npm run build`, with your logo, the section, the page title and the description, in your fonts and colors.
- `image` is the fallback card. Run `npm run generate-og-image` after you set `baseUrl`, your title and your tagline, and again after you change the logo, colors or fonts, to redraw it in your branding.

### Sitemap, Robots And Hidden Pages
- `/sitemap-index.xml` lists every page. Leave one page out with `excludeFromSitemap: true`, or every page in a folder with `[seo.sitemap] exclude`. Drafts are removed for you.
- `/robots.txt` is built from `[seo.robotsTxt]`. Add paths crawlers should skip to `disallow`.

These pages ship hidden from search engines (`noindex`):

| Page | Why |
| --- | --- |
| `/elements/` | The layout gallery, a reference for you |
| `/components/` | The shortcode samples |
| 404 pages | Not real pages |
| Blog category and tag pages with fewer than 2 posts | Thin pages |

The two extra homepages, `/home-2/` and `/home-3/`, are indexed. If you keep one only as a spare, delete it or add `robots: "noindex, follow"` and `excludeFromSitemap: true` to its file. See [Homepages](/lotline/customization/homepages/).

### AI Search And AI Assistants
People ask AI assistants for "real estate agents near me" or "homes for rent in [neighborhood]". Lotline lets those tools read and cite your site, and lets you choose which kinds of AI crawler may visit.

**1. Choose which AI crawlers may visit**

```toml
[seo.robotsTxt]
  aiSearch       = true  # AI search and answer engines that fetch pages to cite them (ChatGPT search, Claude, Perplexity, ...)
  aiTraining     = true  # crawlers that collect content to train AI models (GPTBot, ClaudeBot, Google-Extended, CCBot, ...)
  contentSignals = false # true adds a Content-Signal line (contentsignals.org) with the two choices above
```

Each switch writes `robots.txt` rules for a list of crawlers in `src/lib/utils/aiCrawlers.ts`. `aiSearch = false` removes your site from those engines' answers, and `aiTraining = false` opts out of training only. Neither affects Google Search or AI Overviews, which use the normal Googlebot and follow your regular rules. `contentSignals` ships off because Lighthouse doesn't know the line yet and lowers the SEO score.

**2. `llms.txt` and Markdown copies**

```toml
[seo.ai]
  llmsTxt       = true # /llms.txt (index) and /llms-full.txt (all text), per language
  markdownPages = true # a Markdown copy of each property, development, service, neighborhood, agent, post, job, FAQ and other main page
```

- `/llms.txt` is a Markdown map of your site that some AI tools read, and `/llms-full.txt` holds the text of every page. Both open with your agency facts from `[business]`, then group the links: properties, new developments, services, neighborhoods, agents, pages, the blog and jobs. Each language gets its own (`/fr/llms.txt`, `/ar/llms.txt`). See [AI Links & llms Files](/lotline/features/ai-links-llms/).
- With `markdownPages`, a listing at `/properties/elm-hill-modern-villa/` is also served as `/properties/elm-hill-modern-villa.md`. The included `public/_headers` (Netlify, Cloudflare Pages) and `vercel.json` serve these as text and mark the `.md` copies `noindex`, so search engines don't index them in place of your pages.
- Leave a page out with `excludeFromAi: true`. Pages marked `noindex` and drafts are left out for you.

Search engines don't document any use of `llms.txt`, so treat it as a help for AI tools, not as an SEO setting.

**3. The Copy page and Ask links**

```toml
[settings.pageActions]
  enable    = true
  footer    = true  # a footer row with Ask AI links and the llms files on every page
  providers = ["chatgpt", "claude", "perplexity", "grok"] # empty hides the "Ask" links
```

Property, development, neighborhood, service, agent, job and blog pages get a row under their intro: **Copy page**, **View as Markdown**, and one **Ask** link per assistant.

### IndexNow (Bing And Others)
IndexNow tells Bing, Yandex, Seznam and Naver which pages changed, so they update sooner. Bing also feeds ChatGPT search and Copilot. It ships off.

1. Set a key of 8 to 128 letters, numbers or dashes in `config.toml`: `indexNowKey = "your-key"` under `[seo.ai]`. The build publishes it at `/<key>.txt`.
2. Deploy.
3. After each deploy, run `npm run indexnow`. It sends the pages whose sitemap date changed in the last 7 days. `npm run indexnow -- --all` sends every page (use it at launch), `--days=30` covers a longer period, and `--dry-run` lists the pages without sending them.

New and sold listings change often on an agency site, so this one is worth setting up.

### Do It With AI
```text
Improve SEO for my agency. For every content file with a title in src/content/**/english/,
write a metaDescription of 140 to 160 characters from the page content, and a metaTitle under 60
characters where the title is vague. Don't change other fields. Then do the same in every other
language. Rewrite seo.tagline, seo.siteDescription and seo.keywords in each src/i18n/<language>.json
for [AGENCY NAME, CITY, NEIGHBORHOODS], and check that [site] baseUrl in src/config/config.toml is
"[MY URL]".
```