How to include Sitemap in Robots.txt

Learn how to include your sitemap in Robots.txt. It easy than you think!

Sitemap is a file that contains links to pages of your website or blog. Robots.txt is the file used to give robots like search engine crawlers give instructions to follow when crawling your website. Here’s how to include your sitemap in Robots.txt:

1User-agent: *
2Disallow: /private/
3Sitemap: https://mywebsite.com/sitemap.xml

You have to simply add the Sitemap: YOUR_SITEMAP_URL line to your robots.txt file. It’s that simple! Make sure the sitemap URL is absolute (full URL with https://).

Let’s see some examples with a few different platforms:

  1. Hyvor Blogs

  2. WordPress

Note that if you are using a different platform, the process should be similar.

How to include Sitemap in Robots.txt in Hyvor Blogs?

In Hyvor Blogs, the sitemap line is included in robots.txt by default. You can verify it in Console -> Settings -> SEO.

Sitemap in Robots.txt (Hyvor Blogs)

How to include Sitemap in Robots.txt in WordPress?

It is not quite straightforward with WordPress. If you use an SEO plugin, this step varies depending on the plugin you use. Here are some guides to edit the robots.txt file for some popular plugins:

The other option is to directly edit robots.txt in your WordPress installation. Open the file editor in your WordPress hosting provider and edit robots.txt file and add the sitemap line as explained earlier.

Why add Sitemap to Robots.txt?

The robots.txt file is the main entry point for all (responsible) crawlers. While it is likely that you will be submitting your sitemap to major search engines like Google or Bing manually, adding a sitemap to robots.txt can help all crawlers find the sitemap. This can help robots find all of your content easily.

Conclusion

As explained in this post, adding your sitemap into robots.txt is an easy task, especially if you are using Hyvor Blogs for your blog. Learn more about how Hyvor Blogs handles SEO for you. If you have any questions, feel free to comment below.

Comments