XML Sitemaps: The Beginner’s Guide

This article is part of an SEO series from WooRank. Thank you for supporting the partners who make SitePoint possible.
XML sitemaps are simple text files that are used to provide details for every URL on a website. They include location, date of last modification, change frequency and page priority. If you’ve got an international or multilingual site, you can also use your sitemap to note the relationship between language versions of a URL. All of these elements provide search engine bots with information about your site, helping them crawl and index pages easily and more efficiently.
Here is what the sitemap for a multilingual site should look like:

Here’s a quick rundown of what those terms mean:
<urlset> – This is the current protocol standard for opening and closing sitemaps.
<url> – The tag that denotes the start of each URL entry.
<loc> – The location of the page. Always use absolute URLs uniformly in your sitemaps (https://, www, etc.)
<lastmod> – The last date you modified the page. Always use the YYYY-MM-DD format here.
<changefreq> – How often you make changes to this file.
<priority> – How important this page is to the overall site. The value ranges from 0.0 to 1.0 with 0.5 as the default priority.
<xml:link> – This tag provides URLs to alternate versions of the page. In this case they point to versions of the page in different languages.
The <loc> tag is required for each URL you include in your sitemap, which makes sense. It tells search engine bots where the pages are. It’s also worth noting that you might think you can trick search engines into crawling your site more frequently by making your <changefreq> tag daily, but don’t lie. If crawlers sense that the sitemaps don’t reflect reality they’ll ignore them, which could result in your site being crawled even less frequently.
Add <image> extensions to give Google and Bing information about your images to help them appear in image searches. Image tags for sitemaps should be added in the <url> tag, after the <tag> tag:
<url>

<loc>https://www.example.com</loc&gt;
<image:image>

<image:loc>https://www.example.com/image.jpg</image:loc&gt;
</image:image>

</url>

You can add other optional attributes to your <image> tags to give bots a little more detail:
<image:caption> – A short caption or description for the image.
<image:geo_location> – The geographic location of the image.
<image:title> – Your image’s title.
<image:license> – Contains the URL pointing to the license of your image.
If you’ve got video content on your pages, make it findable in video search by adding the <video> extension to your sitemap. If your page http://www.example.com/video1 has an embedded video, video players or raw video, add <video> elements to the <url>:

<url>

<loc>https://www.example.com/video1</loc&gt;

<video:video>

<video:thumbnail_loc>https://www.example.com/thumbnail/vid1.jpg</video:thumbnail_loc&gt;

<video:title>Sample Video 1</video:title>

<video:description>This is a short description of your video. Maximum 2048 characters.</video:description>

<video:content_loc>https://www.example.com/video/sample1.mov</video:content_loc&gt;

<video:duration>10</video:duration>

</video:video>

</url>

The tags in the example above represent all of the required tags for video elements. However, there’s a lot more you can tell search engines about your page’s video resources in sitemaps:
<video:player_loc> – The URL pointing to the player for the video. If your video is embedded on your page, like from YouTube or Vimeo, you can use this tag instead of <video:content_loc>. You can normally find this URL in the video’s embed code.
<video:duration> – The video’s length in minutes, between 0 and 28800 (8 hours). This isn’t technically required, but Google recommends it.
<video:expiration_date> – Only include this information if your video will not be available after a certain date. If you do use it, put dates in YYYY-MM-DD format, and times in Thh:mm:ss:TZD format.
<video:rating> – The video’s rating. Only values between 0.0 and 5.0 are valid.
<video:view_count> – The number of times the video has been watched.
<video:publication_date> – The date the video was first published, not the date you put it on your site.
<video:family_friendly> – If No, your video will only appear in search results when the user disables SafeSearch. Otherwise, make this Yes.
<video:tag> – A very short description of key concepts related to your video. Create a separate <video:tag> element for each tag you use, up to 32 tags.
<video:category – The broad subject your video covers, such as SEO, Digital Marketing or Advertising.
<video:restriction relationship=allow/deny> – A list of countries where the video cannot play, or a list of the only countries in which users can access the video, dependent on whether you set relationship as allow or deny. The list is space-delimited and uses the ISO 3166 country codes. If you don’t use this tag, it will be assumed that your video is available globally.
<video:gallery_loc> – The URL where you can find the collection in which your video appears, if there is one. Each video can have only one gallery_loc tag. If your gallery has a title you can add the title attribute.
<video:price currency=” ”> – The price to download the video. The currency= attribute is required and uses the ISO 4217 currency code. Add the optional type= attribute to specify if the download is to own or rent, and resolution= to specify if the video is in HD or SD. You can use this multiple times for each currency you accept.
<video:requires_subscription> – Allowed values are yes and no to indicate whether or not a subscription is required to watch the video.
<video:uploader> – If your video is embedded from another video site, put the name of the host here. This URL must be the same domain as the <loc> tag.
<video:platform_relationship=allow/deny> – The platforms, web, mobile, and tv, where the video can or cannot be accessed. The relationship= attribute defines whether the list is inclusive or exclusive. You can have only one platform tag per video.
<video:live> – Whether or not the video is a live stream. Only yes or no are valid.
XML sitemaps are limited by size, both in number of URLs you can include and in file size. Sitemaps can only have 50,000 entries, with up to 1,000 images and a max size of 10MB. If you’ve got a really big site that has lots of pages, images and/or videos, you’ll need to create multiple sitemaps. If you encounter this, you’ll need to create a sitemap of sitemaps, known as a Sitemap Index File.
Continue reading %XML Sitemaps: The Beginner’s Guide%

via Reme Le Hane

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s