How to create a Google sitemap
How to create a Google sitemap
This How to create a Google sitemap article explains a number of tips and tricks that you need to know about to be able to submit your Google sitemap. Creating the Google sitemap can be quite tricky and many webmasters often give up after getting error messages. But creating a Google sitemap is very easy; you just need to follow some rules.
Google has not done a very good job in explaining the sitemap, so we hope this How to create a Google sitemap will help.
How to create a Google sitemap
Before we start explaining how to create a Google sitemap, let's describe the scenario and why you need a Google sitemap. You probably know Google. You probably also know about Google AdSense and Google AdWords. (See here if you need more details about these two platforms: Difference between AdSense and AdWords.) In addition to AdSense and AdWords, Google also offers another two very useful suites. Google Analytics is used for collecting and analyzing traffic on your website. Google Webmaster Tools (http://www.google.com/webmasters/tools) can help you analyze your web site, its design, architecture, links, content, simply all the parts that make up your site.
Why to use Google sitemap...
The Google Webmaster Tools suite allows you to submit a sitemap of your web site. Submitting a sitemap can help Google to discover web pages that their crawler would not discover at all or after some long time. When Google crawls your web site, their robot does it in chunks. The Googlebot indexes a few pages one time, then a few other pages the next time. If you give Google your site map, the Googlebot knows where to go and what to index. You can also define priorities for the Googlebot in your Google sitemap.
How to create a Google sitemap tutorial
Ok, we have learned about the purpose of the Google sitemap, so now we can answer the How to create a Google sitemap question.
Google sitemap format
Google sitemap is easiest to be created either as a XML file or as a text based HTM file. When submitting your Google sitemap as a text file, you create a plain TXT file which you save with the HTM or HTML extension. This file will include one URL per line as shown in the following picture.
In case you decide to go with a XML file, it needs to follow syntax as defined by the Sitemap Protocol 0.9. The following picture shows a sample Google sitemap.
Note that the file shown above is called Sitemap and has the extension XML. Now, let's point out some details and specifics.
Google sitemap XML syntax
We already mentioned that you write one URL per line in the text based HTM sitemap. When creating the XML sitemap, the file must start with the xml and urlset tags. Each URL that you want to include in your Google sitemap must be within the url tags which have one mandatory parameter (LOC) and three optional parameters (LASTMOD, CHANGEFREQ, PRIORITY). They are pretty self explanatory. You just should know that the CHANGEFREQ is just a hint for the Googlebot. The PRIORITY can be set between 0 and 1.
Google sitemap file format (encoding)
One common mistake that can result in the Your Sitemap does not appear to be in a supported format error message is that you save your Google sitemap as ANSI. The file must be saved as UTF-8. After all, you can also see the UTF-8 encoding specified in the XML tag on the first line.
This applies to both the HTM and XML files.
Google sitemap filename
You may have noticed that we named the file Sitemap.htm and Sitemap.xml. It is important to capitalize the first letter and lower case all the remaining letters.
Special characters
URLs often contain special characters such as ampersand, single quotes, double quotes, greater than, or the lower than sign. These special characters must be escaped using entity codes.
Character | Escape Code | |
Ampersand | & | & |
Single Quote | ' | ' |
Double Quote | " | " |
Greater Than | > | > |
Less Than | < | < |
Let's take a look at an example.
Wrong: http://www.example.com/catalog?item=3&name=sitemap
Correct: http://www.example.com/catalog?item=3&name=sitemap
URLs included in Google sitemap must not include upper ASCII characters or certain control codes or special characters such as * and {}.
Consistency in Google sitemap URLs
Take a look at the Google sitemap provided above. See that all URLs are mentioned in the http://www.example.com/ format. The format you decide to use must be consistent throughout the whole Google sitemap file. You can't have one line with a http and the next line without the http.
Preferred domain for Google sitemap
Your URLs in your Google sitemap must be consistent with how you have defined your preferred domain. Go to the Google Webmaster Tools - Dashboard - Settings page and see the Preferred setting.
For example, you may have listed your site as http://www.example.com but specified http://example.com as the preferred domain (without "www" in the URL address). The way you specify your URLs in your Google sitemap must be in sync with your preferred domain.
Images in Google sitemap
Do not include URLs to images in Google sitemaps. Google does not index images directly. They index the page on which the image appears.
Where do I submit my Google sitemap?
Well, you probably already know, but just in case. You submit your Google sitemap through Google Webmaster Tools: https://www.google.com/webmasters/sitemaps/login.
Google sitemap errors
If you make a mistake somewhere, you most likely get the Your Sitemap does not appear to be in a supported format error message. You can find more details about this message behind the link.
Questions about Google sitemap
In case you are at a dead end and need help with How to create a Google sitemap, feel free to visit our discussion forum and ask questions there.
By the way, if you are trying to optimize your website for SEO, you might be interested in the following articles:
36 tips on how to make money with AdSense (AdSense make money)
Google Ad Section
Cheap AdWords keywords
Effects of AdSense bid gap on your AdSense earnings
How to increase Google crawl rate
Last time Google crawled a website
Pagerank sculpting demystified
Good luck with your efforts.
It is easy, just include the code provided below into your HTML code.