TenanciTenanci

Help centerSEO

Sitemap and robots.txt

Choose between the origin's sitemap or one generated by Tenanci for each domain, and manage robots.txt with ready-made templates and validation.

The sitemap lists the pages you want on Google; robots.txt tells crawlers what they may fetch. In a white-label app, both have to talk about the customer's domain, not the origin's address. Tenanci takes care of that on each domain: it rewrites the origin's files or serves yours.

The three sitemap modes

Mode (Site tab → Sitemap) What /sitemap.xml returns
Use the origin's (rewritten to your domain) the origin's sitemap, with addresses switched to the customer's domain (the default)
Generate with Tenanci a sitemap built by Tenanci with only this domain's pages (below)
Off nothing (404)

The mode applies to both /sitemap.xml and /sitemap_index.xml.

  1. Open the Site tab.
  2. Under Sitemap, pick the mode.
  3. Click Save.

What goes into the generated sitemap

In Generate with Tenanci mode, the sitemap combines:

  • the URLs you added on the Sitemap tab (source Manual);
  • the pages the audit found that can go on Google (they return 2xx, have no noindex and their canonical points to themselves), with source Audit. When a complete audit no longer finds a page, it leaves the sitemap;
  • the fixed paths (no * or parameters) of the domain's active routes, or the project's when the domain inherits routes (source Alias);
  • the home page, always.

Paths that are the source of a redirect are left out. Above 50,000 URLs, the sitemap becomes an index with several parts, as the protocol requires. The generated sitemap is only served for active domains.

Add URLs to the sitemap

  1. Open the Sitemap tab.
  2. In the text box, put one URL per line: the path (/pricing) or the full address (https://horizonrealty.com/about).
  3. Click Add URLs.

The table shows Path, Source (Manual, Audit or Alias) and Updated. Use the trash icon to remove a URL and Open generated sitemap to see the XML. If the current mode isn't Generate with Tenanci, a notice reminds you that this list is only served once you switch modes on the Site tab.

robots.txt

With nothing configured, /robots.txt returns the origin's file rewritten to the customer's domain, Sitemap: lines included. To use your own file:

  1. Open the robots.txt tab.
  2. Choose Use a custom robots.txt.
  3. Start from one of the Templates or write the file:
    • Allow everything: allows every crawler and points to the domain's sitemap;
    • Block everything: asks every crawler not to fetch anything;
    • Block AI crawlers: blocks AI training and answer crawlers (GPTBot, ClaudeBot, PerplexityBot, Google-Extended, CCBot and others) and allows search engines.
  4. Fix anything under Errors (they block saving) and review the Warnings.
  5. Click Save.

To go back to the origin's file, choose Use the origin's robots.txt and save. The file can be up to 64 KB.

Through the API

robots.txt with PUT /domains/:id/seo/robots: send robotsTxt with the content, a preset (allow_all, block_all or block_ai), or "robotsTxt": null to go back to the origin's.

cURL
curl -X PUT https://api.tenanci.com/v2/domains/dom_4h7n1q/seo/robots \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"preset":"block_ai"}'

Sitemap URLs with POST /domains/:id/seo/sitemap/urls, one at a time or up to 5,000 in items. Through the API you can also set lastmod, changefreq and priority (0 to 1):

cURL
curl -X POST https://api.tenanci.com/v2/domains/dom_4h7n1q/seo/sitemap/urls \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"path":"/mortgages","changefreq":"monthly","priority":0.8},{"path":"/careers"}]}'

The list and the current mode come from GET /domains/:id/seo/sitemap; to change or remove a URL, use PATCH or DELETE /domains/:id/seo/sitemap/urls/:uid. The sitemap mode is the sitemapMode field of PUT /domains/:id/seo/site.