Resources

How to reference a sitemap in robots.txt

Let’s see how to reference a Sitemap in a robots.txt file in a simple and fast way.

You only have to add one line of code for each Sitemap you want to add, but normally in the robots.txt you only include the index sitemap.

For those who are not familiar with the format of a Sitemap, you can visit this link: http://www.sitemaps.org/es/protocol.html

Example to reference the sitemap in the robots.txt

User-agent: *
Sitemap: https://en.anerbarrena.com/post-sitemap.xml

Now we would only have to put the line of code in the robots.txt of the root of our website.

Share
Published by
Aner Barrena