Adding a sitemap line to robots.txt gives compliant crawlers a simple route to your XML sitemap. The value should be a complete URL.
Sitemap: https://example.com/sitemap.xml
Multiple sitemaps
You may list more than one sitemap, although a sitemap index is often cleaner for large websites. Each referenced URL should return a successful response and valid XML.
Robots.txt and Search Console
Listing the sitemap in robots.txt complements, but does not replace, submitting it through search-engine webmaster tools. Both methods help discovery, while webmaster tools also provide processing reports and error information.
Final checks
- Use HTTPS when the site uses HTTPS.
- Keep the hostname consistent with the preferred domain.
- Remove old staging and development URLs.
- Recheck after changing an SEO plugin.