XML Sitemap is a plain text file that list links to all the pages of your website, it’s like a map of your whole website. This file is created to make it easier for search engines to discover your website. So that it can easily navigate through all the pages of your website. XML Sitemap is used by all the search engines but in this post we’ll mainly focus on Google.

At this time, among all the search engines Google brings the highest amount of traffic to almost all websites on web. It is not necessary to have a xml sitemap for your site to get indexed by Google but it surely helps Search Engines to get all your links indexed. Google can crawl your website without the sitemap file but it would be great if you create a xml sitemap and present it to Google to ensure that no link remain unseen by Google.

Various Type of XML Sitemaps

Nowadays Google accepts additional sitemap for images, videos and mobile. Earlier only a single sitemap was needed, but with growing searches on images, videos and increasing net surfing on mobile phones. Google introduced image, video and mobile xml sitemap. So that website owners could tell Google about all the images and videos on their website. And Google can without any difficulty reach and index the image and videos on a websites.

How to Create Various XML Sitemaps

Manually creating a xml sitemap can be a cumbersome task, as your will have to manually create a list of links to all the pages on your site. In WordPress you can easily create a xml sitemap using various WordPress plugins, which automatically and quickly creates xml sitemap for your website.

Creating General Web XML Sitemap

You can use Google (XML) Sitemaps Generator for WordPress plugin for generating xml sitemap for your WordPress website. This plugin is easy to use and provides various options which can configured according to the user needs. For more info visit plugin’s official Homepage.

Google XML Sitemap WordPress Plugin Snapshot

Screenshot of the Google XML Sitemap Plugin

Creating Image XML Sitemap

You can use Google XML Sitemap for Images WordPress Plugin for generating image xml sitemap for your WordPress blog. For more info visit plugin’s homepage.

Google XML Image Sitemap WordPress Plugin Snapshot

Click the button to generate your Image Sitemap.

Creating Video XML Sitemap

You can use Google XML Sitemap for Videos WordPress Plugin for generating image xml sitemap for your WordPress blog. For more info visit plugin’s homepage.

Google XML Video Sitemap WordPress Plugin Snapshot

Click the button to generate your Video Sitemap.

Watch this Video to learn how to generate XML Video Sitemap using the XML Sitemap for Videos plugin:

httpv://www.youtube.com/watch?v=Zql9_foKPiQ

Creating Mobile XML Sitemap

You can use Google XML Sitemap for Mobile WordPress Plugin for generating image xml sitemap for your WordPress website.

The Mobile Sitemap plugin will generate a sitemap for your WordPress blog with URLs that serve mobile web content.

Google XML Mobile Sitemap WordPress Plugin Snapshot

Click the button to generate your Mobile Sitemap.

Submitting XML Sitemap to Google

We have created all the required sitemaps, now its time to submit these sitemaps to Google.  Remember only creating sitemaps is not enough, you will have to submit the sitemaps to Google via Google Webmaster Tools.

Follow the steps below to submit your xml sitemaps to Google Webmaster Tools:

1. Login to Google Webmaster Tools

2. Add your website if you haven’t done it yet.

3. Goto Site Configuration -> Sitemaps -> Submit a Sitemap

Google Webmaster Tools Submitting Sitemap

4. Insert the sitemap file name and press ‘Submit Sitemap‘ Buttom

Submit Sitemap to Google

Repeat the procedure to add all the sitemaps. Upon adding Google will analyze the sitemap and after some time will show a green tick mark upon successful submission.

Other Important Things to be Taken Care of

There are some other important things you need to take care of for proper usage of your website’s xml sitemaps. These are:

1. Adding XML Sitemap location link to robots.txt file.

The very first file search engine crawlers check upon lending on your website is robot.txt file. Adding sitemap links to robots.txt file will inform crawlers about the location of sitemap files.

See the sample below:

Sitemap: http://domain-name/sitemap-web.xml
Sitemap: http://domain-name/sitemap-image.xml
Sitemap: http://domain-name/sitemap-video.xml

Add these lines at the top and replace ‘domain-name’ with your website address url.

2. Prevent Search Engines from indexing your XML Sitemaps

XML Sitemaps are created primarily for search engine bots but since they also have text, they may even show-up in regular search results thus competing with your other pages. To see this for yourself, try a phrase like filetype:xml inurl:sitemap on Google. -labnol.org

John Mueller of Google Zürich has suggested a way to prevent this problem. He suggested to serve sitemap files with a ‘noindex x-robots-tag’ to prevent them from getting indexed.

John Muller x-robots-tags

How to prevent sitemaps from being getting indexed

1. Goto the directory where xml sitemaps are, they are generally on the top-level folder of your WordPress directory.

2. Open .htaccess file for editing. Add the following lines to the .htaccess file. [via]

<IfModule mod_rewrite.c>
  <Files ~ "^(sitemap1|sitemap2|sitemap3)\.xml$">
   Header set X-Robots-Tag "noindex"
  </Files>
 </IfModule>

Remember to replace sitemap1, sitemap2, etc. with the actual file names, excluding the ‘.xml‘ extension (for eg. sitemap-web, sitemap-image)

Once you have done, you can now test the changes by going to URI Valet. And enter the full url of any of the three sitemaps. Press ‘Submit‘ and check for ‘X-Robots-Tag: noindex‘ in the displayed results. If its present, you have successfully implemented the above procedure.