In this article, we’ll teach you how to add the Sitemap to your robots.txt file.
Before knowing how to add your sitemap, it is important to understand that the robots.txt file is the first place crawlers visit when accessing a website. You need to provide the details of every page on your website that you want the search engines to discover. Plus, the location of your sitemap is also very significant.
In order to better understand your domain, especially for the Site Audit, Ubersuggest will look for the sitemap inside the robots.txt file. So, it is very common to see an audit issue “Missing sitemap” even when it is already inside your Google Search Console (GSC).
Because of that, we advise adding your sitemap URL to your robots.txt file to ensure Ubersuggest detects it, but it's also considered a good practice. But how can you do that?
Adding Your Sitemap
Step 1: Find your sitemap URL.
By default, your sitemap's URL will be /sitemap.xml. However, it is important to note that some websites have more than one. If you use Yoast SEO, a sitemap index will be added to /sitemap_index.xml.
If you have access to your website's File Manager, you can search for XML sitemap files. In case you don’t have a sitemap, you can create one yourself. There are many tools available on the web.
You can find more about how to create a sitemap in this article: How to Create an SEO-Boosting XML Sitemap in 20 Minutes (or Less)
Step 2: Find your robots.txt
First, type your domain after robots.txt to check if you have a robots.txt file available.
For example, neilpatel.com/robots.txt
If you don’t find one, you must create and add it to the root directory of your web server. You should consider getting the help of a developer.
Normally, you put the file where your site’s main “index.html” is located.
Step 3: Adding the Sitemap to Robots
For this to happen, you will need to access your web server, unless you use an SEO plug-in that manages the robots without checking the server.
So, to add your sitemap to your robots, all you have to do is place a directive with the URL in your robots.txt file, as we show below:
Sitemap: https://neilpatel.com/sitemap.xml
So, the robots.txt file should look like this:
User-agent:*
Allow:
Sitemap: http://befound.pt/sitemap.xml
NOTE: The directive containing the sitemap location can be placed anywhere in the robots.txt file. It is independent of the user-agent line, so it does not matter where it is placed.
You can always find more information about Ubersuggest in our Knowledge Base:
Understanding the Site Audit
Running a Site Audit with Ubersuggest
For any questions, please click on the Help button at the end of this page.