Types of XML Sitemaps In SEO – Sitemap.xml Explained

Types of XML Sitemaps In SEO – Sitemap.xml Explained

You are currently viewing Types of XML Sitemaps In SEO –  Sitemap.xml Explained

Sitemaps seem to assist pages that have been demoted to Google’s supplementary index in transitioning to the primary index. This scheme serves as a supplement to, rather than a substitute for, the usual link-based crawl performed by search engines.

What is Sitemap.xml?

An XML (Extensible Markup Language) sitemap is a list of your websites’ URLs. In addition, you can add some extra details (metadata) about each URL – url, last update time, priority, changefreq, and alternate canonical. Including these details help search engines to crawl your website effectively to find new and updated web pages more efficiently.

Different types of XML sitemaps in SEO

There are several types of sitemap.xml files that website owners can use to provide search engines with different types of information about their website’s content. Here are some of the most common types of XML sitemap:

There are basically two types of XML sitemaps.

  • Index Sitemap (multiple URL sitemaps of website)
  • URL Sitemap (consist information about the webpage URLs, images, videos etc.)
  • Mobile Sitemap

XML URL sitemaps are further divided into 3 different categories –

  • Sitemaps for webpages (usually defines as XML sitemap which consists URLs of webpages)
  • Image sitemaps (include details about the images across the website)
  • Video sitemaps (include webpages that have videos embedded in)

Final tree of sitemap.xml categorization we have is –

  • XML Sitemap
    • Index Sitemap
    • URL Sitemap
      • Sitemaps for Webpages
      • Sitemaps for Images
      • Sitemaps for videos
    • Mobile Sitemap

Types of XML Sitemap in SEO

Index XML Sitemap

Sitemap Index XML file is the most basic and important types of sitemaps xml files, which lists all of the pages on a website that should be indexed by search engines.

The <sitemapindex> is the root element of a sitemap_index.xml file, which is used to list multiple types of sitemaps files for a website. It is an XML element that contains one or more <sitemap> elements, each of which provides a link to a specific sitemap file. It is often used when a website has a large number of pages or multiple sitemap files.

Here is an example of the <sitemapindex> element:

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://www.example.com/sitemap1.xml</loc>
    <lastmod>2022-03-15</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://www.example.com/sitemap2.xml</loc>
    <lastmod>2022-03-16</lastmod>
  </sitemap>
</sitemapindex>

The sitemap_index.xml file contains links to other sitemap files on the website, each of which lists a specific section or type of content on the site. This can make it easier for search engines to find and crawl all of the pages on a website, especially if the site has a complex structure or a large number of pages.

The sitemap_index.xml file follows the same XML structure as a regular sitemap.xml file and includes the <sitemapindex> root element, which contains one or more sitemap elements. Each <sitemap> element represents a single sitemap file and includes a <loc> element that specifies the URL of the sitemap file.

By using a sitemap_index.xml file, website owners can make it easier for search engines to discover and index all of the pages on their site, which can help to improve the site’s overall search engine visibility and ranking.

Image Sitemap.xml

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" 
        xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
  <url>
    <loc>https://example.com/page1.html</loc>
    <image:image>
      <image:loc>https://example.com/image1.jpg</image:loc>
    </image:image>
    <image:image>
      <image:loc>https://example.com/photo1.jpg</image:loc>
    </image:image>
  </url>
  <url>
    <loc>https://example.com/page2.html</loc>
    <image:image>
      <image:loc>https://example.com/picture1.jpg</image:loc>
    </image:image>
  </url>
</urlset>

image:image

Include all information about a single image. Each <url> tag can contain up to 1,000 <image:image> tags.

Image sitemaps are the types of sitemaps that provides search engines with additional information about the images on your website. It helps search engines better understand the images on your website, which can lead to increased visibility in image search results.

Image sitemaps contain metadata about each image, such as the image’s URL, caption, title, and license information. This information can help search engines determine the relevance and quality of the image, and it can also help them understand the context in which the image is used on your website.

Having an image sitemap is important if you have a website with a lot of images or if you rely on image search traffic.

  • An image sitemap is used for images.
  • Image sitemap helps images to get indexed in Google Image Search
  • <image:image> and <image:loc> tags are required tags for an image sitemap
  • <image:caption>, <image:title>, <image:title> and <image: geo_location> are optional tags.

Video Sitemap.xml

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
   <url>
     <loc>https://www.abcde.com/videos/some_video_landing_page.html</loc>
     <video:video>
       <video:thumbnail_loc>https://www.abcde.com/thumbs/123.jpg</video:thumbnail_loc>
       <video:title>Grilling steaks for summer</video:title>
       <video:description>
         Alkis shows you how to get perfectly done steaks every time
       </video:description>
       <video:content_loc>
          http://123.abcde.com/video123.mp4
       </video:content_loc>
       <video:player_loc>
         https://www.abcde.com/videoplayer.php?video=123
       </video:player_loc>
       <video:duration>600</video:duration>
       <video:expiration_date>2021-11-05T19:20:30+08:00</video:expiration_date>
       <video:rating>4.2</video:rating>
       <video:view_count>12345</video:view_count>
       <video:publication_date>2007-11-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="EUR">1.99</video:price>
       <video:requires_subscription>yes</video:requires_subscription>
       <video:uploader
         info="https://www.abcde.com/users/grillymcgrillerson">GrillyMcGrillerson
       </video:uploader>
       <video:live>no</video:live>
     </video:video>
     <video:video>
       <video:thumbnail_loc>https://www.abcde.com/thumbs/345.jpg</video:thumbnail_loc>
       <video:title>Grilling steaks for winter</video:title>
       <video:description>
         In the freezing cold, Roman shows you how to get perfectly done steaks every time.
       </video:description>
       <video:content_loc>
          
       </video:content_loc>
       <video:player_loc>
         https://www.abcde.com/videoplayer.php?video=345
       </video:player_loc>
     </video:video>
   </url>
</urlset>

Having video sitemaps is important if you have a website with a lot of videos or if you rely on video search traffic. These types of sitemaps provide search engines a detailed information about your videos, you can help them understand the content of your website and improve your visibility in video search results.

Mandatory Video Sitemap Tags

video:video

<video:video> is the parent element that consists all information about a single video on webpage described in <loc> tag. You can add multiple <video:video> tags embedded in the <loc> tag, one for each video on the web page.

video:thumbnail_loc

<video:thumbnail_loc> tags includes URL that indicates to the video thumbnail image file. All you need to follow thumbnail requirements of the video.

video:title

This tag is used for video title. We advise that video title match the video title written on the web page where the video is uploaded.

video:description 

<video:description> tag describes the video description. The maximum length of description can be 2048 characters. Video description in sitemap must match the description displayed on the web page where the video is posted, but it doesn’t require to be a word-for-word match.

video:content_loc

A URL indicating the actual media (video) file address. The video file must be in supported video formats.

Additional guidelines

  • HTML and Flash media files aren’t supported formats.
  • <loc> parent url and <video:content_loc> video url can’t be same.
  • This is the similar like VideoObject.contentUrl in structured data.

video:player_loc

A URL denoting to a player for a specific video. Usually, this video information is declared in src attribute of an <embed> tag.

  • Video url can’t be same as the <loc> URL.

Optional Video Sitemap Tags

video:duration

Video duration in seconds. The second value can be between 1 second to 28800 (8hours).

video:expiration_date

Expirration date defines when the video is going to expire. Remove this tag, if you don’t want google to remove this video after this date. For uploading frequent videos at the same URL, change the expiration date in video sitemap.

Supported date and time formats are – complete date (YYYY-MM-DD), or complete date plus hours, minutes and seconds, and time zone (YYYY-MM-DDThh:mm:ss+TZD).

Eg: 2023-04-13T08:20:30+08:00.

video:rating

Video rating can be in float number ranging between 0.0(low) to 5.0(high)

video:view_count

It will generate the count for number of times video is watched.

video:publication_date

The date when the video was published. Video publication date supports complete date (YYYY-MM-DD) or complete date plus hours, minutes and seconds, and time zone (YYYY-MM-DDThh:mm:ss+TZD).

Example: 2023-04-16T08:05:30+08:00

video:family_friendly

Write “No”; only in case video is available only for the users with turned off Safesearch. But if you write “yes” or remove the tag, the video will be available when SafeSearch is turned on.

Supported values:

  • yes: SafeSearch is on
  • no: SafeSearch is off

video:restriction

If you want to show or hide the video from specific countries in search results. Only one <video:restriction> can be used for every video. If you don’t use restriction tag, google consider that video can be shown in all locations. <video:restriction> only influences search results, it doesn’t stop a user from finding or playing video in restricted area through other methods.

<video:restriction relationship="allow">IN UK US</video:restriction>

Supported Attributes:

If the tag <video:restriction> is used, you can use following supported values:

  • Allow – Video will be visible in listed countries and denied in unlisted countries.
  • Deny – video will not be visible for listed countries and allowed for unlisted countries.

video:platform

On which platform you want to show or hide your video on specific type of platforms. This is a space-delimited type of tag. You can list different platforms using spaces. This tag only put an impact on search results, it does not restrict a user from playing video on a restricted platform.

Only one <video:platform> tag can present for every video. If you don’t use this tag, google pretends that the video can be played on all platforms.

Supported values:

  • web – desktop and laptop browsers
  • mobile – mobile browsers, such as those on cellular phones or tablets
  • tv – TV browsers, smart TV or GoogleTV enables devices and game consoles.
<video:platform relationship="allow">web tv</video:platform>

Attributes:

With the <video:platform> following attributes are used –

  • allow: any excluded platforms will be denied.
  • deny: any excluded platforms will be allowed.

video:requires_subscription

<video:requires_subscription> tag defines whether a subscription is needed or not to view the video. Supported vales for this tag are –

  • yes: subscription is must.
  • no: subscription is not needed.

video:uploader

The name of video uploader person. There can be only one <video:uploader> per video. The length of value can up to 255 characters.

Attributes:

Info – optional: webpage url with some information about the uploader. The url must be similar as mentioned in <loc> tag.

video:live

To show that the video is live stream or not.

Supported values:

  • yes: video is a live stream.
  • no: video is not a live stream.

video:tag

<video:tag> tag includes an arbitrary string describing video. Tags are very short description with key features of video content. Eg. “health”, “car”, and “food” etc.

Create a new <video:tag> element for every tag associated with the video. Maximum 32 tags are allowed.

News Sitemap.xml

News Sitemaps are basically used for news websites, it is recommended to create a Google News Sitemap to manage the content that you submit to Google News. These types of sitemaps enable you to control which content to submit to Google News. However, before you can use a news sitemap, you need to register your site in Google News to ensure that it is recognized by the search engine.

Once you have completed the registration, you can add all the news articles that were published in the past two days to the sitemap, with a maximum of 1,000 URLs. It is crucial to update the sitemap each time a new article is published to keep it current and ensure that your content is easily discoverable by Google News.

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
  <url>
    <loc>https://example.com/article1</loc>
    <news:news>
      <news:publication>
        <news:name>Example News</news:name>
        <news:language>en</news:language>
      </news:publication>
      <news:publication_date>2022-04-13T12:30:00-08:00</news:publication_date>
      <news:title>Article 1 title</news:title>
      <news:keywords>keyword1, keyword2, keyword3</news:keywords>
    </news:news>
  </url>
  <!-- Add more URLs as needed -->
</urlset>

Tags of News Sitemap

news:news

The <news:news> tag is a child tag of the URL sitemap tag and belongs to the news: namespace. Each URL sitemap tag can contain only one <news:news> tag (along with its corresponding closing tag), and a news sitemap can contain a maximum of 1,000 <news:news> tags. If you have more than 1,000 news articles to include in your sitemap, it is recommended to split the sitemap into multiple smaller sitemaps to avoid any issues.

news:publication  

The <news:publication> tag is a child tag of the <news:news> parent tag and belongs to the news: namespace. It is the parent tag for the <news:name> and <news:language> tags. Each <news:news> parent tag can have only one <news:publication> tag (along with its corresponding closing tag), and this tag provides information about the publication that is the source of the news article.

news:name

The <news:name> tag is a child tag of the <news:publication> parent tag and belongs to the news: namespace. It is used to specify the name of the news publication that is the source of the news article. The name specified in the <news:name> tag must exactly match the name as it appears on your articles on news.google.com, without including anything that is in parentheses. This ensures that the publication is correctly identified and associated with the news article in Google News.

news:language

The <news:language> tag is the language of your publication. Use an ISO 639 language code (two or three letters).

The <news:language> tag is a child tag of the <news:publication> parent tag and belongs to the news: namespace. It is used to specify the language of the news publication that is the source of the news article. To indicate the language, use an ISO 639 language code, which consists of either two or three letters. This ensures that Google News can correctly identify the language of the publication and associate it with relevant search queries.

Exception: For Simplified Chinese, use zh-cn and for Traditional Chinese, use zh-tw.

news:publication_date 

To specify the publication date of a news article in a Google News Sitemap, use the W3C date format. You can use either the “complete date” format (YYYY-MM-DD) or the “complete date plus hours, minutes, and seconds” format with a time zone designator (TZD) format (YYYY-MM-DDThh:mm:ssTZD). It is important to specify the original date and time when the article was first published on your site, not the time when you added the article to your sitemap. This ensures that Google News can accurately display and sort your news articles by publication date.

Google understands any of the following formats:

  • Date format: YYYY-MM-DD (1997-07-16)
  • Date plus hours and minutes: YYYY-MM-DDThh:mmTZD (1997-07-16T19:20+01:00)
  • Date plus hours, minutes, and seconds: YYYY-MM-DDThh:mm:ssTZD (1997-07-16T19:20:30+01:00)
  • Date plus hours, minutes, seconds, and a decimal fraction of a second: YYYY-MM-DDThh:mm:ss.sTZD (1997-07-16T19:20:30.45+01:00)

news:title

The <news:title> tag is a child tag of the <news:news> parent tag and belongs to the news: namespace. It is used to specify the title of the news article that is being included in the Google News Sitemap. The title should accurately and concisely represent the content of the article and attract the interest of potential readers.

Mobile Sitemap.xml

Mobile sitemaps – these types of sitemaps are only require for websites that have a separate mobile version. If your site uses responsive design to serve mobile users, there is no need to create a separate mobile sitemap, because the URL for the page is the same for both desktop and mobile users. Additionally, if you annotate your mobile version using HTML, a mobile sitemap extension is not necessary. However, if your website has a separate mobile version with different URLs, then creating a mobile sitemap can help ensure that Google properly indexes and displays your mobile content in search results.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
 xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0">
  <url>
    <loc>http://www.example.com/</loc>
    <xhtml:link 
       rel="alternate" media="only screen and (max-width: 640px)"     
       href="http://m.example.com/"
    />
  </url>
</urlset>

When building a mobile sitemap for a website with a separate mobile version, make sure to add the XML namespace for mobile. Then, use the <xhtml:link> tag to specify the mobile version of the URL, including the following attributes:

  • rel=”alternate”: Indicates that the URL being specified is an alternate version of the main URL.
  • media=”only screen and (max-width: 640px)”: Specifies the media type for which the alternate URL should be used. In this case, it is set to only apply to screens with a maximum width of 640 pixels, which is a common size for mobile devices.
  • href=”http://www.m.example.com/”: Specifies the URL for the mobile version of the page.

By including these attributes in the <xhtml:link> tag, you can ensure that Google properly identifies and indexes the mobile version of your website in search results.

Conclusion

Different types of sitemaps XML file carry different kind of information’s about urls, videos, news, images, categories, taxonomies, and mobile website URLs etc. in an organized and pre-defined format. If you have a large or complex website, try using various types of sitemaps for your website to keep it simple for yourself and search engine crawlers.

Overall, using different types of sitemaps xml files can help website owners to provide search engines with more detailed and specific information about their website’s content, which can help to improve the overall visibility and search engine rankings of the site.

Leave a Reply