Sitemap

What is a Sitemap?

A sitemap is an HTML or XML file that provides information about web pages, images, videos on your site and their relationship.

Why it is important?

It is important because it provides valuable additional information to search engines like:

  • when the page was last updated
  • Important top-most priority pages
  • other language versions of a page if any
  • To improve the crawling of large and complex sites.

Who needs it?

  1. For large and complex sites with no proper inter-linking, there is a chance of crawlers overlooking some of the newly created or updated pages.
  2. If your site has a lot of rich media elements like videos, images and it is a google news approved site there is a chance of google taking additional information from your site and site pages when required.

How to build a Sitemap?

 First Choose one among the 3 google’s supported sitemap formats:

  • XML format
  • Text Format
  • RSS, mRSS, and Atom 1.0

Then You can create a sitemap using online sitemap generators like XML Sitemaps.com or you can create it manually by following the below-given XML sitemap code formats for webpages, images, news, and videos.

XML Sitemap code format:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/seo.html</loc>
<lastmod>2022-02-24</lastmod>
</url>
<url>
<loc>http://www.example.com/email.html</loc>
<lastmod>2022-02-25</lastmod>
</url>
</urlset>

2) RSS, mRSS, and Atom 1.0

RSS (Really simple syndication) file contains information about recent updates on a site.

Bloggers can submit RSS feed URLs as sitemaps. Bloggers can also provide mRSS (media RSS) URL to give information about video content on your site.

3) Text

You can submit a sitemap.txt (UTF-8 encoding) file provided with only URLs (one URL per line).

sitemap.txt format:

http://www.example.com/seo.html
http://www.example.com/email.html

Site Map extensions for Video, Images, News Media types:

XML site map for images:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://example.com/seo.html</loc>
<image:image>
<image:loc>http://example.com/seo.jpg</image:loc>
</image:image>
<image:image>
<image:loc>http://example.com/off-page.jpg</image:loc>
</image:image>
</url>
<url>
<loc>http://example.com/email.html</loc>
<image:image>
<image:loc>http://example.com/email-tools.jpg</image:loc>
<image:caption>A picture list of email marketing tools </image:caption>
<image:geo_location>Hyderabad, India</image:geo_location>
<image:title>Email Marketing</image:title>
<image:license>http://example.com/image-license</image:license>
</image:image>
</url>
</urlset>

XML site map for videos

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/videos/free-seo-tools.html</loc>
<video:video>
<video:thumbnail_loc>http://www.example.com/thumbs/how-to-use-mozbar.jpg</video:thumbnail_loc>
<video:title>Tutorial on How to use Mozbar </video:title>
<video:description>In this tutorial, You will learn how to use mozbar to find important SEO metrics like DA, PA, DoFollow and NoFollow links.
</video:description>
<video:content_loc>
http://streamserver.example.com/mozbar.mp4</video:content_loc>
<video:player_loc>
http://www.example.com/videoplayer.php?video=123</video:player_loc>
<video:duration>420</video:duration>
<video:expiration_date>2024-02-05T19:20:30+08:00</video:expiration_date>
<video:rating>4.2</video:rating>
<video:view_count>58</video:view_count>
<video:publication_date>2022-02-05T19:20:30+08:00</video:publication_date>
<video:family_friendly>yes</video:family_friendly>
<video:restriction relationship="allow">IE GB US CA</video:restriction>
<video:price currency="INR">1.99</video:price>
<video:requires_subscription>yes</video:requires_subscription>
<video:uploader info="http://www.example.com/users/webmarketersguide">WebMarketersGuide
</video:uploader>
<video:live>no</video:live>
</video:video>
</url>
</urlset>

XML site map for News

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.org/seo/algorithm-updates.html</loc>
<news:news>
<news:publication>
<news:name>The News Times</news:name>
<news:language>en</news:language>
</news:publication>
<news:publication_date>2022-03-08</news:publication_date>
<news:title>Core Algorithm Update </news:title>
</news:news>
</url>
</urlset>

Guidelines on how to create a Site Map:

  1. Size of site map and site map index file (with multiple sitemaps) should not be greater than 50MB and they should not contain more than 50,000 URLs.
  2. Specify the site map path in robots.txt file to remind search engines next time they crawl robots.txt file.
             Sitemap: https://example.com/my_sitemap.xml

3. If your site is large site then you can create a sitemap index file (parent) with all the child sitemaps included as mentioned in the below format and submit it in search console.     

Sample code of site map index file:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>http://www.example.com/sitemap1.xml.gz</loc>
  </sitemap>
  <sitemap>
    <loc>http://www.example.com/sitemap2.xml.gz</loc>
  </sitemap>
</sitemapindex>
  • Provide complete URL address with (www or non-www).
  • child site maps that are referenced in the parent sitemap index file must be in the same directory of site map index file or in the lower path.

Example: for the below site map index file

https://example.com/sitemap/sitemap_index.xml (parent)

the child sitemaps location can be https://example.com/sitemap/child/..

Author

Pandith,
Is the creative head of the Web Marketers Guide (WMG) and an Experienced Digital Marketing Analyst. Worked as a marketing professional for various start ups and Immigration Industries.

Reading time: 6 minutes