# Sitemaps, robots & schema

> Configure clean URLs, XML sitemaps, robots.txt rules, canonical tags, JSON-LD structured data, and Google Search Console so search and AI crawlers index cleanly.

- Canonical: https://exaspark.ai/docs/technical-seo-and-sitemaps/

## How crawlers discover, filter, and understand pages

Search engines like Google and Bing—alongside AI answer engines like ChatGPT Search, Perplexity, Gemini, and Claude—evaluate published ExaSpark apps through four sequential stages.

- **Discovery.** Crawlers find public URLs through `/sitemap.xml` and clean internal `<a>` links in navigation, footers, and catalogs.
- **Crawl control.** Crawlers read `/robots.txt` and HTTP status codes (`200`, `301`, `404`) to decide which routes to fetch and which operational paths to skip.
- **Canonicalization.** `<link rel="canonical">` tags and `301` redirects assign ranking credit to one HTTPS URL when duplicate variants exist.
- **Understanding.** Semantic headings (`<h1>`–`<h3>`), plain-English copy, and Schema.org **JSON-LD** supply structured facts for rich snippets and AI citations.

> **Note:** Never treat `robots.txt` or `noindex` as access control. Both are public crawler hints, not security boundaries. Always guard private data with server-enforced roles and [Row-level data privacy](https://exaspark.ai/docs/row-level-data-privacy/).

## Designing clean, crawlable URLs and canonicals

Descriptive lowercase URLs such as `/pricing`, `/services/deep-cleaning`, or `/products/espresso-grinder` communicate hierarchy clearly to visitors and crawlers alike. Avoid opaque numeric query URLs (`/item?id=4821`) or client-only hash routes (`/#pricing`) for public content.

Every public route should emit a self-referencing `<link rel="canonical">` tag using the exact HTTPS URL of your primary custom domain, stripping tracking parameters (`?utm_source=...`, `?fbclid=...`, `?ref=...`) so ad clicks never fragment ranking signals.

| Route type | Example | In `sitemap.xml`? | Directive | Purpose |
| --- | --- | --- | --- | --- |
| **Core public pages** | `/`, `/pricing`, `/about`, `/faq` | Yes | `Allow` + self-canonical | Primary landing routes for search and AI queries |
| **Dynamic detail pages** | `/listings/:slug`, `/classes/:slug` | Yes (published only) | `Allow` + self-canonical | Captures specific long-tail searches |
| **Filtered search results** | `/listings?sort=price&tag=new` | No | `noindex, follow` | Prevents thousands of duplicate URL permutations |
| **Signed-in app areas** | `/dashboard`, `/account`, `/admin` | No | `Disallow` + `noindex` | Keeps private app shells out of search results |
| **Checkout callbacks** | `/checkout/success`, `/auth/callback` | No | `noindex` | Transactional routes have no value in search |

After connecting a custom domain in [Custom domains, DNS & SSL](https://exaspark.ai/docs/custom-domains-and-dns/), point every canonical tag and sitemap entry to that primary host rather than `.exaspark.app`; see [Subdomains & www redirects](https://exaspark.ai/docs/subdomains-and-redirects/).

## Building XML sitemaps that stay accurate

An XML sitemap hands Google and Bing an authoritative list of indexable pages. Small marketing sites work cleanly with a static `/sitemap.xml`, whereas database-backed directories, storefronts, or booking marketplaces should generate `/sitemap.xml` dynamically from published records.

- **List only canonical `200 OK` URLs.** Exclude redirects (`301`), `404` pages, login-gated routes, and `noindex` pages.
- **Keep `<lastmod>` honest.** Update timestamps only when content genuinely changes so crawlers trust your freshness signals.
- **Respect file limits.** Keep each sitemap under `50,000` URLs and `50 MB` uncompressed; use a sitemap index for larger catalogs.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://yourdomain.com/</loc>
    <lastmod>2026-04-12</lastmod>
  </url>
  <url>
    <loc>https://yourdomain.com/pricing</loc>
    <lastmod>2026-04-10</lastmod>
  </url>
  <url>
    <loc>https://yourdomain.com/classes/intro-pilates</loc>
    <lastmod>2026-04-11</lastmod>
  </url>
</urlset>
```

## Writing a safe robots.txt policy

Serve `/robots.txt` at your domain root (`https://yourdomain.com/robots.txt`). Block private operational routes while leaving public pages, CSS, JavaScript, and images crawlable so search engines render layouts accurately.

- **Never block CSS or JS assets.** Blocking static scripts breaks mobile rendering checks and harms rankings.
- **Never leave `Disallow: /` on Live.** Verify after launch that no staging lockout rule shipped by mistake.
- **Declare your full HTTPS `Sitemap:` URL.** Explicit sitemap references speed discovery for both search and AI crawlers.

```text
User-agent: *
Allow: /
Disallow: /admin/
Disallow: /dashboard/
Disallow: /account/
Disallow: /api/

Sitemap: https://yourdomain.com/sitemap.xml
```

## Adding JSON-LD structured data without errors

JSON-LD embeds machine-readable facts inside `<script type="application/ld+json">` without changing visual layout. Search engines and AI answer engines inspect JSON-LD to verify your brand, pricing, service area, availability, and FAQ answers.

Keep JSON-LD strictly aligned with visible page copy. Listing prices, offers, or FAQs that do not appear on the screen violates search guidelines and causes crawlers to ignore your schema.

Use a connected `@graph` block on your homepage to link your `Organization` entity to your `SoftwareApplication` (or `LocalBusiness`) and `Offer`:

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": "https://yourdomain.com/#org",
      "name": "CourtSide Booking",
      "url": "https://yourdomain.com/",
      "logo": "https://yourdomain.com/icon-512.png"
    },
    {
      "@type": "SoftwareApplication",
      "name": "CourtSide Booking",
      "applicationCategory": "BusinessApplication",
      "operatingSystem": "Web, Android",
      "publisher": { "@id": "https://yourdomain.com/#org" },
      "offers": {
        "@type": "Offer",
        "price": "19.00",
        "priceCurrency": "USD"
      }
    }
  ]
}
```

## Prompts to generate your technical SEO stack

Wire your full crawlable stack in one prompt, then publish and inspect `/robots.txt` and `/sitemap.xml` directly in your browser.

For marketing websites and SaaS landing pages:

> **Example prompt (Web):** Implement technical SEO using https://yourdomain.com as our canonical host: add self-referencing canonical tags ignoring UTM parameters, serve /robots.txt disallowing /admin, /dashboard, and /api while referencing /sitemap.xml, generate /sitemap.xml with all public routes, add Organization and FAQPage JSON-LD matching visible text, and serve a clean 404 page for unknown paths.

For database-backed catalogs, marketplaces, or booking directories:

> **Example prompt (App):** Create a dynamic /sitemap.xml route listing static public pages plus every published listing from the database with updated_at dates. Output unique titles, meta descriptions, canonical links, and Product or Service JSON-LD on /listings/:slug, and add meta robots noindex to authenticated /dashboard and /account pages.

## Verifying Google Search Console and requesting indexing

Verifying your domain in **Google Search Console** speeds initial discovery and exposes crawl or canonical mistakes early.

1. **Confirm custom domain HTTPS** — Ensure your canonical domain resolves over HTTPS with clean redirects from alternate hostnames.
2. **Add a Domain property** — In Google Search Console, choose **Domain** (covering apex, `www`, and subdomains together) and copy the DNS `TXT` verification value.
3. **Publish the TXT record** — Add the root (`@`) `TXT` row at Cloudflare, GoDaddy, Namecheap, or Squarespace without editing existing `A`, `CNAME`, or `MX` records; see [Cloudflare & registrar DNS](https://exaspark.ai/docs/dns-cloudflare-godaddy/).
4. **Verify and submit your sitemap** — Click **Verify**, open **Indexing > Sitemaps**, and submit `https://yourdomain.com/sitemap.xml`.
5. **Request indexing on priority URLs** — Paste your homepage and core landing routes into **URL Inspection** and click **Request indexing**.

## Technical SEO troubleshooting table

| Audit or Search Console symptom | Likely cause | Concrete fix |
| --- | --- | --- |
| **`Sitemap could not be read`** | `/sitemap.xml` returns HTML fallback or malformed XML | Open `/sitemap.xml` directly and return valid XML with `application/xml` |
| **`Duplicate without user-selected canonical`** | `www`, apex, or `.exaspark.app` serves duplicate pages | Enforce `301` redirects and point every canonical tag to one host |
| **`Blocked by robots.txt` on public page** | Overly broad `Disallow` rule blocks a public route | Update `/robots.txt` to allow public paths and retest in URL Inspection |
| **`Discovered - currently not indexed`** | Thin copy, orphan route without internal links, or brand-new domain | Add concrete unique copy, link from homepage/footer, and request indexing |
| **JSON-LD error in Rich Results Test** | Missing required Schema.org field (e.g., `priceCurrency`) | Validate the live URL and match JSON-LD fields to visible page facts |
| **Private `/dashboard` appears in Google** | Route lacked `noindex` and was publicly linked | Add `<meta name="robots" content="noindex">` and server-side login checks |

## Next steps

- [SEO & AI search visibility](https://exaspark.ai/docs/seo-and-ai-search/) — Complete guide to page titles, Open Graph cards, and AI citations.
- [Speed & Core Web Vitals](https://exaspark.ai/docs/page-speed-and-core-vitals/) — Optimize LCP, CLS, and INP so crawled pages rank and convert.
- [Subdomains & www redirects](https://exaspark.ai/docs/subdomains-and-redirects/) — Enforce one canonical hostname across every protocol and subdomain.

## From the blog

- [SEO and GEO for a new website](https://exaspark.ai/blog/seo-and-geo-for-a-new-website/) — Practical playbook for ranking on Google and AI answer engines.
- [How to create a website with AI](https://exaspark.ai/blog/how-to-create-a-website-with-ai/) — Build and launch a search-ready website cleanly from day one.
- [How to get your first users](https://exaspark.ai/blog/how-to-get-your-first-users/) — Pair technical SEO indexing with early distribution channels.
