The “Sitemap.xml not indicated in robots.txt” warning means your robots.txt file has no Sitemap line. To fix it, add one line with the full, absolute URL of your sitemap, such as Sitemap: https://www.example.com/sitemap.xml, anywhere in the file. Save it at the root of your domain, then re-run the audit.
That’s all it takes in most cases. People get stuck on the details: a relative URL, a WordPress setup where the file you edit isn’t the file being served, or an audit of the wrong version of the domain.
This guide covers only that job. If you want the bigger picture of what each file does, read robots.txt and XML sitemaps explained first.
Try it: Robots.txt GeneratorCreate a correct robots.txt with rules per crawler, crawl-delay, sitemap links and a one-click preset to block AI crawlers.
Open tool — freeWhat does “sitemap.xml not indicated in robots.txt” mean?
It means the audit tool fetched yourdomain.com/robots.txt and found no line starting with Sitemap:. Site audit tools such as Semrush flag it because robots.txt is the standard place any crawler can look to discover where your sitemap lives.
It’s usually listed as a notice, not an error. If you’ve already submitted your sitemap in Google Search Console, Google knows where it is. Bing, other search engines and third-party crawlers, though, often rely on the robots.txt reference, so the line is worth adding even when Google is covered.
You can also see the warning when a Sitemap line exists but the tool can’t use it. Common reasons are a relative URL, a sitemap address that returns an error, or a line sitting in the robots.txt of a different host than the one being audited.
The robots.txt sitemap directive: exact syntax
The directive is one line: the word Sitemap, a colon, a space, and the complete URL of the sitemap file.
Sitemap: https://www.example.com/sitemap.xmlHere’s a full, minimal robots.txt with the sitemap in place:
User-agent: *
Disallow: /search/
Sitemap: https://www.example.com/sitemap.xmlAlways use an absolute URL
The value must include the protocol and host name. Sitemap: /sitemap.xml is the single most common mistake, and crawlers simply skip it. Use the exact version of your site that’s live: if every page redirects to https://www., write that, not http:// or the bare domain.
You can list several sitemaps
Add one Sitemap line per file. This is normal for sites with separate sitemaps for posts, products, images or different languages.
Sitemap: https://www.example.com/sitemap-pages.xml
Sitemap: https://www.example.com/sitemap-products.xml
Sitemap: https://www.example.com/sitemap-images.xmlIf you use a sitemap index (a sitemap that lists other sitemaps), listing just the index is enough. Crawlers follow it to the child files. Adding the children as well doesn’t hurt, it’s just redundant.
Capitalization of the directive
Field names in robots.txt are case-insensitive under the standard, so Google reads sitemap: fine. Still, write Sitemap: with a capital S. It’s the conventional form, and some simpler audit tools only match that spelling. The URL is a different story: paths are case-sensitive, so /Sitemap.xml and /sitemap.xml can be two different files.
Placement in the file
The Sitemap line isn’t part of any User-agent group. It applies to every crawler no matter where it appears. Most people put it at the very end, after a blank line, so it’s easy to find. Putting it under User-agent: Googlebot doesn’t limit it to Google, and putting a # in front of it turns it into a comment that everyone ignores.
| Line in robots.txt | Works? | Why |
|---|---|---|
Sitemap: https://www.example.com/sitemap.xml | Yes | Absolute URL, standard spelling |
Sitemap: /sitemap.xml | No | Relative path is ignored |
sitemap: https://www.example.com/sitemap.xml | Usually | Valid for Google, but some tools expect a capital S |
Sitemap: http://example.com/sitemap.xml on an https www site | Weak | Points at a redirect instead of the final URL |
Sitemap https://www.example.com/sitemap.xml | No | Missing colon |
Sitemaps: https://www.example.com/sitemap.xml | No | Misspelled directive |
How do I add a sitemap to robots.txt?
On a regular website where you upload files yourself, it takes five steps.
- Find your sitemap URL. Try
/sitemap.xml,/sitemap_index.xmland/wp-sitemap.xmlin your browser. If none of them load and you don’t have one, build it with our free XML sitemap generator and upload it to your site root. - Open
yourdomain.com/robots.txtand copy what’s already there. Never replace an existing file with a blank one, since you’d lose rules someone added for a reason. - Add the Sitemap line at the end. If you’d rather rebuild the whole file cleanly, the robots.txt generator has a field for sitemap links and writes the line in the correct format.
- Save it as plain text named
robots.txt, all lowercase, and upload it to the root of the host, the same folder as your home page. A robots.txt inside a subfolder is never read. - Reload
yourdomain.com/robots.txtin a private window to confirm the new version is live and not a cached copy.
WordPress: virtual robots.txt and which sitemap to list
WordPress adds a twist. There may be no robots.txt file on your server at all. When no physical file exists, WordPress generates a virtual one every time someone requests /robots.txt, and plugins can add lines to it.
- WordPress core (5.5 and later): creates a sitemap at
/wp-sitemap.xmland adds a Sitemap line for it to the virtual robots.txt, as long as the site isn’t set to discourage search engines. - Yoast SEO: replaces the core sitemap with its own at
/sitemap_index.xml. Recent versions add it to the virtual robots.txt, and the plugin’s Tools section includes a file editor for robots.txt. - Rank Math: also uses
/sitemap_index.xml, adds it to the virtual file, and offers a robots.txt editor in its general settings.
The catch is that a physical file always wins. If someone uploaded a robots.txt through FTP or your host’s file manager, WordPress and the SEO plugin can’t add anything to it, and their editors may be disabled or show a notice. This is the most common reason the warning appears on WordPress sites that “definitely have a sitemap.” Either add the line to the physical file yourself, or delete that file to go back to the virtual one, but only after checking it doesn’t contain rules you still need.
List the sitemap that’s actually active. With Yoast or Rank Math running, /wp-sitemap.xml usually redirects to their index, so point to sitemap_index.xml directly rather than to a URL that redirects.
How to verify the fix
- Read the live file. Open robots.txt in a private window and check the line character by character: protocol, host, path, colon.
- Open the sitemap URL. Copy it straight from robots.txt into your browser. You should see XML, not your 404 page or a login screen.
- Check Google Search Console. The robots.txt report under Settings shows the version Google last fetched and when. You can ask it to recrawl after a change. Submitting the sitemap in the Sitemaps report is still worth doing.
- Re-run the audit. Many audit tools only update on their next scheduled crawl, so trigger a fresh one before deciding the fix failed.
Why the warning sometimes stays
If the line is there and the tool still complains, check these:
- Wrong host.
www.example.com,example.comandshop.example.comeach have their own robots.txt. The audit checks the host it crawls. - Caching. A CDN or caching plugin keeps serving the old file. Purge the cache for
/robots.txt. - Robots.txt redirects or errors. If the file itself returns a redirect chain or a server error, tools may not read it at all.
- Sitemap URL is broken. The line exists but points at a file that returns 404, often after switching SEO plugins.
The two-minute fix, in short
One line, absolute URL, at the end of the file, served from the root of the exact host you’re auditing. On WordPress, check for a physical robots.txt overriding the virtual one before you blame your SEO plugin. If you’re cleaning up the whole file anyway, generate it with our robots.txt generator, upload it, and confirm both URLs load in a private window.
Frequently asked questions
Do I need to add my sitemap to robots.txt if I submitted it to Google?
It is not required for Google, which already knows about a sitemap you submitted in Search Console. Adding the line still helps Bing, other search engines and SEO tools find it, and it costs nothing.
Can robots.txt have more than one sitemap?
Yes. Add a separate Sitemap: line for each file, each with its full URL. If you have a sitemap index, listing just the index is enough.
Where should the Sitemap line go in robots.txt?
Anywhere in the file, because it is not tied to a User-agent group. Most people put it at the end, after a blank line, so it is easy to spot.
Is the robots.txt sitemap directive case-sensitive?
The word Sitemap is not case-sensitive for Google, but writing it with a capital S is the safe convention. The URL itself is case-sensitive, so it must match the real file name exactly.



