Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Sitemap not in robots.txt: how to add the Sitemap line

SEO-100Low impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

A robots.txt file sits at the root of your site (for example https://www.example.com/robots.txt). It tells crawlers which paths they may fetch. It can also hold a Sitemap: line, which tells any crawler where your XML sitemap is.

This issue means that line is missing. Your sitemap may exist and work fine. It is just not announced in robots.txt. The directive is part of the sitemaps protocol and is read by Google, Bing and other crawlers.

Why it costs you leads or sales

The impact is low, and it is indirect. A sitemap helps crawlers find new and updated pages, such as landing pages, product pages and booking pages. If a crawler does not know where the sitemap is, it relies on links and on whatever you submitted in Search Console or Bing Webmaster Tools.

The risk is highest for new sites, sites with weak internal links, and crawlers you never submitted to, including smaller search engines and some AI crawlers. A page that is slow to be discovered is slow to bring in visitors. The robots.txt line is a cheap safety net.

How a missing Sitemap line slows discovery
  1. Crawler visitsFetches /robots.txt
  2. No Sitemap lineNo pointer to the sitemap
  3. Relies on linksDeep or new pages found late
  4. Slower indexingNew landing pages appear later

A crawler reads robots.txt first. Without the pointer it has to find pages through links alone.

How to check if your site has it

Check your robots.txt in about a minute
  1. Open the file

    Go to https://yourdomain.com/robots.txt in a browser. Check the exact version of your site that people use (with or without www).

  2. Look for a Sitemap line

    Search the page (Ctrl+F or Cmd+F) for Sitemap:. It is not case sensitive, and it can be anywhere in the file.

  3. Check the URL in the line

    It must be a full URL starting with https://, on your live domain, and it must open in the browser.

  4. Check from the command line (optional)

    Run curl -s https://yourdomain.com/robots.txt | grep -i sitemap. No output means there is no line.

How to fix it

First find your real sitemap address. Common ones are /sitemap.xml, /sitemap_index.xml (Yoast) and /sitemap.xml on Shopify and Wix. Open it in a browser to be sure it loads. Then add the line to robots.txt.

Example robots.txt with a Sitemap linetext
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

Sitemap: https://www.example.com/sitemap_index.xml

Use the full URL, not a relative path like /sitemap.xml. The line is independent of any User-agent group, so it can go at the top or bottom. You can list more than one Sitemap: line if you have several sitemaps.

Add the line on your platform
  1. Check what already writes robots.txt

    WordPress creates a virtual robots.txt. Yoast SEO and Rank Math usually add the Sitemap line themselves. If yours is missing, confirm that the plugin's XML sitemap feature is switched on.

  2. Edit it with your SEO plugin

    In Yoast SEO go to Tools > File editor. In Rank Math go to General Settings > Edit robots.txt. Add the Sitemap line and save.

  3. Watch for a physical file

    If a real robots.txt file exists in the site root, it overrides the virtual one. Edit that file instead, or delete it if you want the plugin to manage it.

How to confirm it's fixed

Confirmation checklist
  • /robots.txt on the live domain shows a Sitemap: line
  • The URL is absolute, uses https and matches your preferred domain (www or non-www)
  • The sitemap URL opens in a browser and returns valid XML, not a 404 or a redirect chain
  • Google Search Console > Settings > robots.txt report shows the latest fetch with no errors
  • Search Console > Sitemaps shows your sitemap with a Success status

How to prevent it happening again

Robots.txt often gets overwritten during a redesign, a migration, a plugin swap or a theme change. Staging settings also sometimes get copied to the live site.

Habits that keep the line in place
  • Add robots.txt and sitemap to your launch and migration checklist
  • Keep a copy of your approved robots.txt in version control or in a shared document
  • Re-check robots.txt after changing SEO plugins, themes or hosting
  • Check it again whenever your domain or www setting changes
  • Set a monthly reminder to open /robots.txt and the sitemap

How FunnelGuard handles this

FunnelGuard does not check this yet. A missing Sitemap line in robots.txt is a possible future check, but today it is not monitored.

What FunnelGuard does do is run your real customer journeys (lead forms, checkouts, booking and chat buttons) on a schedule, check the tracking hits sent to ad and analytics platforms, and confirm test leads reach your inbox and CRM. That covers conversions, not search crawling.

To watch for this issue yourself, use the monthly reminder above, or use Google Search Console (the robots.txt report and the Sitemaps report) and Bing Webmaster Tools. A site crawler such as Screaming Frog can also flag it. The free FunnelGuard read-only website audit is another way to get a general look at your site.

robots.txt before and after

Before

  • Only User-agent and Disallow rules
  • No pointer to the sitemap
  • Crawlers rely on links and manual submissions

After

  • One absolute Sitemap: line with https
  • Any crawler that reads robots.txt sees the sitemap
  • Easy to verify in a browser

Questions people ask

Do I need to add my sitemap to robots.txt?

It is not required, but it is recommended. The Sitemap line is a standard way to tell every crawler where your sitemap is, without a separate submission to each search engine. It costs one line and carries no risk when the URL is correct.

How do I add a sitemap to robots.txt?

Open your robots.txt file and add a line like Sitemap: https://www.example.com/sitemap.xml using your real full URL. Save it, then load yourdomain.com/robots.txt in a browser to confirm the line appears. On platforms like Shopify, Wix and Squarespace the line is usually added for you.

Where should the Sitemap line go in robots.txt?

Anywhere in the file. It does not belong to a User-agent group, so top or bottom both work. Most people put it at the end, on its own line, with a blank line before it.

Can I use a relative URL for the sitemap in robots.txt?

No. Use the full absolute URL, including https:// and the domain. A path like /sitemap.xml may be ignored by crawlers.

Can I list more than one sitemap in robots.txt?

Yes. Add one Sitemap: line per file, each with a full URL. If you use a sitemap index, you can list just the index, since it points to the child sitemaps.

Why is my sitemap not in robots.txt on WordPress?

Your SEO plugin may have its sitemap feature turned off, or a physical robots.txt file may be overriding the virtual one that WordPress and plugins generate. Turn on the sitemap in Yoast or Rank Math, or edit the physical file directly.

Is submitting the sitemap in Search Console enough?

It works for Google, but it does not help crawlers you have not submitted to. The robots.txt line covers any crawler that reads the file. Doing both is the safest option.

Does FunnelGuard check for a missing Sitemap line in robots.txt?

No, not yet. It is a possible future check. For now, check robots.txt by hand, or use Search Console, Bing Webmaster Tools or a site crawler.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.