• Embed Doc
  • Readcast
  • Collections
  • 1
    CommentGo Back
Download
 
SiteGround TutorialsSitemap Tutorial
In this tutorial we will show you how to create and validate a Sitemap for your website. If you don't havea website yet, you can sign up here for our feature-richhosting accountand easily create your websitewithin minutes!Before we continue with the exact steps of generating your Sitemap, we will provide you with somegeneral information on Sitemaps.
What is a Sitemap?
For the purposes of this tutorial we will focus on
Sitemap Protocol 0.9
introduced bySiteMaps.orgwhichis a standard, validated and used by Google and most other search engines. A Sitemap allows you to create a file hosted among the other files in your account that informs thesearch engines of all pages your website contains. In other words, it provides the search engine withdetailed information about the content of your website. Although Sitemaps are mainly used to improve the index process of your website by search engines,they can be used to provide accessibility to certain pages as well. For example, pages that are notaccessible via your menus, can be indexed by the search engine if you want.The Sitemap does not affect the normal way crawler bots index your page – it just extends the visibilityand accessibility of your content.
Please note, that having a Sitemap on your website does not guarantee that a certain pages willbe indexed and included by the search engines. It neither affects your page rank.
 
Sitemap Tutorial includes:
What is theSitemap formatand how does anexample Sitemaplook like; How to havemultiple Sitemaps and Sitemap index,How tovalidate your Sitemaps. All our resources are being constantly updated and improved to make sure SiteGround continues tooffer the besthosting packagewith the richest set of features for every website.
Sitemap Format
The Sitemap Protocol requires certain tags to be present in your
 XML file
in order to be properlyrecognized. The sitemap file should be also
UTF-8 encoded
. In this tutorial section we will explain howdoes this work.
Basic Sitemap example
Here is a very basic example of a sitemap file. For our example here we use a single URL:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://domain.tld/</loc><lastmod>2008-01-01</lastmod><changefreq>daily</changefreq>  <priority>0.1</priority></url></urlset> You can check the next section of this tutorialor for a more complicatedSitemap example.
XML tags in the Sitemap file
Below we will revise the lines of the sitemap file one by one:Every Sitemap XML file must begin with an opening tag
<urlset>
and must end with
</urlset>
.Every "parent" entry should begin with
<url>
tag and end with
</url>
.In a similar way, every "child" entry should be placed between
<loc>
and
</loc>
tags. After a
<loc>
tag, an URL is expected which should start with "
http://
".The length of the URL can be
2048
characters at most.The
<lastmod>
tag expects a date in the following format
 YYYY-MM-DD
.Be advised that you do not have to modify this tag each time you modify the document. Thesearch engines will get the dates of the documents once they crawl them.The
<changefreq>
tag is used as a hint for the crawlers to indicate how ofter the page ismodified and how often it should be indexed.
Note that this value may or may not affect the crawl bot behavior which depends solely onthe search en ine.
 
 
 
The
<changefreq>
tag expects one of the following values:
always, hourly, daily, weekly,monthly, yearly, never
.Be advised that "
always
" is used for pages which are dynamically generated orchanged/modified upon every access. As for the "
never
" value – be advised that even if youmark your page with a never value most probably it will be indexed once in a week for example.The
<priority>
value can vary from 0.0 to 1.0.
Be advised that this indicates only your personal preferences for the way you would like tohave your website indexed.
The default value of a page that is not prioritized is 0.5. Any page with higher value will becrawled before the page with priority 0.5, and all pages with lower priority will be indexed afterthe page with 0.5 value.Since the priority is relative it is used only for your website and even if you set a high priority toall of your pages this does not mean that they will be indexed more often, because this value isnot used to make comparison between different websites.
Special characters in the Sitemap file
 As we have mentioned before your sitemap should be UTF-8 encoded. This can be done when you saveyour sitemap file. Almost all text editors support saving in UTF-8 format.Be advised that all data in the Sitemap should use entity escape codes for the characters listed below:
Character
 
Escape Code
  Ampersand & &amp;Single Quote ' &apos;Double Quote " &quot;Greater Than > &gt;Less Than < &lt;
Don't forget, that your sitemap can not be larger than 10 MB!
 
Sitemap Example
The best way to understand the structure of the Sitemap is to look at an existing one. Therefore, wehave prepared a sample map that you can use for backbone of your personal one. You can copy its codefrom the lines below, and adjust it to serve your particular needs.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.domain.com /</loc><lastmod>2008-01-01</lastmod><changefreq>weekly</changefreq><priority>0.8</priority></url><url><loc>http://www.domain.com/catalog?item=vacation_hawaii</loc><changefreq>weekly</changefreq></url><url><loc>http://www.domain.com/catalog?item=vacation_new_zealand</loc><lastmod>2008-12-23</lastmod><changefreq>weekly</changefreq></url><url><loc>http://www.domain.com/catalog?item=vacation_newfoundland</loc><lastmod>2008-12-23T18:00:15+00:00</lastmod><priority>0.3</priority></url><url><loc>http://www.domain.com/catalog?item=vacation_usa</loc><lastmod>2008-11-23</lastmod></url></urlset> 
Multiple Sitemaps and Sitemap Index
The Sitemap has certain limitations. For example, it cannot contain more than 50 000 URLs and cannotbe bigger than 10 MB. This is why if you plan to create a website with multiple subdirectories andSitemaps, you will have to use Sitemap Index.The
Sitemap index
allows you to include several Sitemap files under one file called Sitemap index. Ituses almost the same syntax but instead of including your pages URLs, you will have to add the URLs toyour Sitemaps.
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...

Thanks. Great tutorial mate... Here's the Video Tutorial: http://bit.ly/cXQPGN - If you prefer video like myself. Don't get me wrong, I still like ur tutorial!

You must be to leave a comment.
Submit
Characters: ...