Google Sitemaps basics

Rate this tutorial:
  • Currently Note: 3/5
  • 1
  • 2
  • 3
  • 4
  • 5

This tutorial will show You how to read and make simple, static Google Sitemaps. If You have static, small site this will be a good idea to make such map yourself.


What is Google Sitemaps?

Sitemap is a beta technology which was provided by google to improve crawlers/bots indexing accuracy.

How it works?

Sitemap is a file which contain a list of URLs of pages within your web site that you want to be indexed. Just place those URLs in sitemap and google crawler will visit them.

How sitemap file look like?

The easest example is:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
  http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
  <url>
    <loc>http://www.yoursite.com/</loc>
    <lastmod>2007-09-15T09:31:11-05:00</lastmod>
    <changefreq>daily</changefreq>
    <priority>0.7</priority>
  </url>
</urlset>

A little explanation
First 5 lines of code is a "headers" - You don't need to edit them.

<url></url> - Everything between those two is Your single URL info.
<loc></loc> - The URL of destination page. This is required!
<lastmod></lastmod> - Date and time of the last modification. Optional.
<changefreq></changefreq> - You can "tell" google bot how often Your site is updated. Optional.
<priority></priority> - How this site is "important" (between 0.1 to 1 scale). Optional.

This is the whole XML file.
You have to remember, that sitemap can carry up to 50.000 sites or 10MB of data.
If You need to have more links You can make a "map of maps" - Sitemap Index. This file is similar to a normal Sitemap but contain links to smaller sitemaps.


<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.google.com/schemas/sitemap/0.84">
<sitemap>
  <loc>http://www.yoursite.com/sitemap1.xml</loc>
  <lastmod>2007-09-15T09:31:11-05:00</lastmod>
</sitemap>
<sitemap>
  <loc>http://www.yoursite.com/sitemap2.xml</loc>
  <lastmod>2007-09-15T09:31:11-05:00</lastmod>
</sitemap>
</sitemapindex>


After You create Your sitemap file (or Sitemap Index), You have to save it as (for example) sitemap.xml.
You can validate Your map before submiting it to google:
http://www.w3.org/2001/03/webdata/xsv

For validation schema use:
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd

Now You can enter https://www.google.com/webmasters/sitemaps/ and submit your site/sitemap.

If You want, You may try to make Dynamic PHP Google Sitemap

Comments

hmm

2009-06-02

Just basics :)

hyznmrzwx

2014-01-04


umsbpaety

2014-01-08


qnskayhcf

2014-01-12