How do you add a sitemap to robots.txt?

  • 29th September 2016
  • SEO
No Comments

Adding a sitemap to the robots.txt is incredibly easy. Not much can go wrong, however you MUST have the sitemap url as an absolute url (http://www.domain.com/sitemap.xml for example)

Lets take an example robots.txt:

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

 

To add a sitemap, you would add the following:

Sitemap: http://thomasharvey.me/sitemap.xml

 

So the overall robots.txt would now be the following:

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: http://thomasharvey.me/sitemap.xml

 

See the robots.txt documentation for Google: https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt


I'm a digital marketing consultant based near Peterborough, England. I'm active on the SEO Chat forums and Moz. I'm always on the look out for things to test and to learn that little bit more.

About me and this blog

I'm a digital marketing consultant, posting as much as I can that will help people learn about SEO and other topics. 

Request a free quote

I offer various SEO services that help websites increase their online presence, I offer packages for every single type of website. 

Subscribe to our newsletter!

Fields marked with an * are required
No Comments
 

More from our blog

See all posts