In this article, you’ll learn:
- What is an XML sitemap?
- What are the benefits of having an XML sitemap?
- How to create an XML sitemap?
- Tips to improve your site’s SEO via an XML sitemap
- How to submit an XML sitemap to Google?
What is an XML Sitemap?
An XML sitemap is a file where webmasters add links to specific pages from your website that you want search engine bots to crawl. XML sitemap ensures that your website gets crawled more intelligently by the search engine crawlers.
Example of an XML sitemap:
Benefits of having an XML sitemap
Creating an XML sitemap is essential for every website because there are several benefits aligned with this single file:
- All of your pages associated with your domain will get indexed efficiently by the crawlers.
- You can specify the crawl priority of your pages in the sitemap. The search engine bots will perform the crawl accordingly.
- For new websites with less number of backlinks, a sitemap can help all its pages get discovered and indexed.
How to create an XML sitemap?
Step 1. Create An XML Sitemap Manually
Every site must have a robust internal linking structure so that all its associated pages get discovered and indexed by the search engine bots conveniently.
One of the best practices concerning internal linking is to link the important pages of your website closer to the most important page of your website: the homepage.
After that, you must link those pages with the less important pages and so forth.
Optimizing your site according to this hierarchy makes the creation of an XML sitemap more convenient.
Also, when all of your site’s pages interlink with each other, the bot will be able to crawl and index each page.
When creating an XML sitemap for your website, you must begin with compiling all the related links and provide supplementary data along with each one:
- Location
- Last modified
- Change frequency
- Priority of a page
Since the crawlers read and understand codes so you must specify the data in the XML file using this code:
<url>
<loc>https://www.yourwebsite.com/blog/create-xml-sitemap</loc>
<lastmod>2018-08-01</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
You have to provide the code for each URL, which requires a lot of time.
Therefore, if your site has hundreds of pages, you should use a Sitemap Generator tool.
Step 2. Create A Sitemap Using Tools
Using Sitemap Generator tools can save time and reduce the errors that surface during manual creation of sitemaps to a minimum.
Several useful tools can help you create an XML sitemap of your website with ease.
Just Google ‘XML Sitemap Generator’, and you’ll find an extensive list of XML sitemap generator tools.
You can use these tools to create your site’s XML sitemap along with the supplementary data and code.
When you are done creating a sitemap, you run it through an XML Sitemap Validator tool to check for errors and fix them
Step 3. Add the Sitemap to Your Site’s Root Folder
After creating and validating your XML sitemaps, the next step is to upload the XML sitemap to your site’s root folder.
This is a 3-step process:
- Log in to the control panel of your current web host
- Find the public_html directory. This directory contains other vital pages of your website such as index.php
- Once you locate the public_html directory, copy and paste the XML sitemap in it.
Tips for creating a well-planned XML sitemap
There are certain things you need to keep in mind when creating an XML sitemap.
1. Add a majority of high-quality URLs
The number of high-quality URLs of your domain should be more than low-quality URLs in the sitemap.
This is because when the crawler comes across too many low-quality URLs, it determines the site to be one where visitors will not find an efficient solution to their queries.
2. Remove pages with the no-follow directive
‘No-follow’ is a robots.txt directive that informs the search engine crawlers that a page must not be crawled.
So, when you are adding links to a sitemap, check that pages with active no-follow directive are not added to the file.
Otherwise, the crawler will be confused about whether to crawl a particular URL or not.
3. Include ONLY canonical URLs
A canonical tag is used to inform the search engine bots about the version of a page (among the duplicates) that needs to be ranked.
Therefore, you must add only the canonical variant of the duplicate pages in the sitemaps to ensure the efficient utilization of the crawl budget allotted to your domain.
How to submit an XML sitemap to Google?
When you are finished with creating your site’s XML sitemap, you should submit it to Google on priority. Now, Google provides you with two options to submit XML sitemap
Submit XML Sitemap using Robots.txt
Does your site have a robots.txt file?
If not, you should create a robots.txt file because it instructs the search engine bots on how to perform the crawl on a website.
A robots.txt file is placed in the header tag of a website.
This way, the crawlers discover it immediately as they begin to crawl your domain and carry it out intelligently.
Adding your XML sitemap is a pretty straightforward process.
Open your robots.txt file and place the sitemap code containing information about your sitemap inside robots.txt
Your robots.txt file should look similar:
Sitemap: http://www.yourwebsite.com/sitemap.xml
Submit XML Sitemap Via Google Search Console
Another popular way of submitting an XML sitemap to Google is through Google Search Console.
Submit an XML sitemap to Googles with simple 4-step process:
1. Log in to Google Search Console
Embedded content: https://woocommerce.com/wp-content/uploads/2019/08/[email protected]
2. Open ‘Sitemaps’
3. In the left-side menu, click on ‘Index’
4. This triggers a dropdown where you can find ‘Sitemaps’
5. Click open ‘Sitemaps’
6. Provide your XML sitemap URL
Note: In the ‘Add a new sitemap’ section, you need to provide the URL to your XML sitemap. Also, if you have submitted any sitemaps previously, they will be recorded in the section ‘Submitted sitemaps’
7. Press 'Submit’
This final action submits your sitemap to Google.
Conclusion
Sitemaps are treasure maps that guide search engine crawlers to the riches, the golden pages of your website that receive stellar traction.
Every site, even if it has 100 pages or 100,000 pages, must create an XML sitemap and submit it to Google on priority.
Now that you’ve learned plenty about sitemaps, including the two ways of submitting them to Google, let me know which one you found more convenient.
Also, mention the tools or techniques you used to create the XML sitemap for your website.