> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hadoseo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sitemap Setup

> Configure your sitemap to ensure all pages are pre-rendered and cached

## Why Sitemaps Matter

Hado SEO uses your sitemap to discover and **pre-warm the cache** for all your pages. Without a proper sitemap:

* Pages are only rendered **on-demand** when first visited
* The first visitor (often a search bot) gets a slower response
* Some pages may never be discovered or cached

With a sitemap, Hado SEO:

* **Pre-renders all pages** before they're visited
* Ensures fast responses for every bot visit
* Keeps your cache fresh with automatic recrawls

## Check If You Have a Sitemap

Visit `https://yourdomain.com/sitemap.xml` in your browser.

**If you see XML with your page URLs** → You're set! Hado SEO will automatically discover and cache all listed pages.

**If you get a 404 or error** → You need to add a sitemap. Follow the instructions below for your platform.

## Adding a Sitemap by Platform

<AccordionGroup>
  <Accordion title="Lovable" icon="heart">
    Lovable apps don't include a sitemap by default. Ask Lovable to create one:

    ```
    Add a sitemap.xml file to my app that includes all public pages.
    The sitemap should be accessible at /sitemap.xml and include:
    - The homepage (/)
    - All public routes in my app
    - Proper lastmod dates
    - Use my custom domain: https://yourdomain.com
    ```

    **Example sitemap for a typical Lovable app:**

    ```xml theme={null}
    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
      <url>
        <loc>https://yourdomain.com/</loc>
        <lastmod>2024-01-15</lastmod>
        <priority>1.0</priority>
      </url>
      <url>
        <loc>https://yourdomain.com/about</loc>
        <priority>0.8</priority>
      </url>
      <url>
        <loc>https://yourdomain.com/pricing</loc>
        <priority>0.9</priority>
      </url>
      <url>
        <loc>https://yourdomain.com/contact</loc>
        <priority>0.7</priority>
      </url>
    </urlset>
    ```
  </Accordion>

  <Accordion title="Base44" icon="cube">
    Base44 apps require custom sitemap configuration in Hado SEO:

    1. Go to your [Hado SEO Dashboard](https://hadoseo.com/dashboard)
    2. Select your domain → **Domain Settings**
    3. Scroll to **Custom sitemap.xml**
    4. Paste your sitemap XML
    5. Click **Save**

    Hado SEO will serve this sitemap at `yourdomain.com/sitemap.xml`.
  </Accordion>

  <Accordion title="Bolt.new" icon="bolt">
    Ask Bolt to add a sitemap:

    ```
    Create a sitemap.xml that lists all public pages in my app.
    Include the homepage and all routes. Use https://yourdomain.com as the domain.
    ```
  </Accordion>

  <Accordion title="Vercel / Next.js" icon="triangle">
    **For Next.js App Router (recommended):**

    Create `app/sitemap.ts`:

    ```typescript theme={null}
    import { MetadataRoute } from 'next'

    export default function sitemap(): MetadataRoute.Sitemap {
      return [
        {
          url: 'https://yourdomain.com',
          lastModified: new Date(),
          priority: 1,
        },
        {
          url: 'https://yourdomain.com/about',
          lastModified: new Date(),
          priority: 0.8,
        },
        // Add all your pages here
      ]
    }
    ```

    **For Pages Router:**

    Use [next-sitemap](https://www.npmjs.com/package/next-sitemap) package.
  </Accordion>

  <Accordion title="Netlify" icon="server">
    Create a `public/sitemap.xml` file in your project with your pages listed.

    For dynamic sites, generate the sitemap at build time using your framework's tools.
  </Accordion>

  <Accordion title="Replit" icon="code">
    Create a route that serves XML at `/sitemap.xml`:

    ```javascript theme={null}
    app.get('/sitemap.xml', (req, res) => {
      res.type('application/xml');
      res.send(`<?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
      <url>
        <loc>https://yourdomain.com/</loc>
        <priority>1.0</priority>
      </url>
      <!-- Add more URLs -->
    </urlset>`);
    });
    ```
  </Accordion>
</AccordionGroup>

## Sitemap Requirements

For Hado SEO to properly pre-warm your cache:

| Requirement           | Details                                                 |
| --------------------- | ------------------------------------------------------- |
| **Accessible URL**    | Must be at `/sitemap.xml` or referenced in `robots.txt` |
| **Valid XML**         | Must be properly formatted XML                          |
| **Correct domain**    | URLs must use your custom domain, not your platform URL |
| **Public pages only** | Don't include login-required or private pages           |

## What to Include

<CardGroup cols={2}>
  <Card title="Include" icon="check">
    * Homepage
    * All public pages
    * Blog posts
    * Product pages
    * Landing pages
  </Card>

  <Card title="Exclude" icon="xmark">
    * Login/signup pages
    * Dashboard/admin pages
    * API endpoints
    * Preview/draft pages
  </Card>
</CardGroup>

## Sitemap Fields Explained

```xml theme={null}
<url>
  <loc>https://yourdomain.com/page</loc>
  <lastmod>2024-01-15</lastmod>
  <changefreq>weekly</changefreq>
  <priority>0.8</priority>
</url>
```

| Field        | Required    | Description                                                               |
| ------------ | ----------- | ------------------------------------------------------------------------- |
| `loc`        | Yes         | Full URL of the page                                                      |
| `lastmod`    | Recommended | Last modification date (YYYY-MM-DD). Helps Hado SEO know when to refresh. |
| `changefreq` | Optional    | How often content changes (daily, weekly, monthly)                        |
| `priority`   | Optional    | Importance 0.0-1.0. Higher priority pages are refreshed more often.       |

<Tip>
  Including accurate `lastmod` dates helps Hado SEO refresh your cache only when content actually changes, saving resources and ensuring freshness.
</Tip>

## Verify Your Sitemap

After adding your sitemap:

1. Visit `https://yourdomain.com/sitemap.xml` to verify it loads
2. Check that all URLs use your custom domain
3. Go to your Hado SEO dashboard
4. Click **Sync Sitemap** to trigger discovery
5. Watch the Pages tab populate with your URLs

## Dynamic Sitemaps

If your app has dynamic content (blog posts, products, user profiles), you need a sitemap that updates automatically.

<CardGroup cols={2}>
  <Card title="Supabase + Lovable" icon="database" href="/guides/dynamic-sitemap-supabase">
    Generate sitemaps from your database
  </Card>

  <Card title="Base44" icon="cube" href="/guides/dynamic-sitemap-base44">
    Create dynamic sitemaps with Base44 functions
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Pages not appearing in dashboard" icon="circle-question">
    **Check:**

    * Is `sitemap.xml` accessible at your domain?
    * Are URLs using your custom domain (not `.lovable.app`)?
    * Did you click **Sync Sitemap** in the dashboard?
    * Is the XML valid? (Check for syntax errors)
  </Accordion>

  <Accordion title="Sitemap returning 404" icon="circle-question">
    Your app doesn't have a sitemap configured.

    **For Lovable/Bolt:** Ask the AI to add one
    **For Base44:** Configure in Domain Settings
    **For custom apps:** Create the file or route
  </Accordion>

  <Accordion title="Wrong URLs in sitemap" icon="circle-question">
    Make sure your sitemap uses your **custom domain**, not your platform URL.

    **Wrong:**

    ```xml theme={null}
    <loc>https://myapp.lovable.app/about</loc>
    ```

    **Correct:**

    ```xml theme={null}
    <loc>https://myapp.com/about</loc>
    ```
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="SEO Optimization" icon="chart-line" href="/guides/seo-optimization">
    Complete SEO checklist for your app
  </Card>

  <Card title="Dashboard Overview" icon="gauge" href="/dashboard/overview">
    Monitor your cached pages
  </Card>
</CardGroup>
