and also supports the inclusion of the time. ISO 8601 is very nicely described at
tells Google how often the page changes. The possible values are
pages that change with each request),
lets you tell Google how you evaluate the importance of individual pages of your
web site as compared to the others. The value is a number between 0.0 and 1.0. Please note that
element only has significance over the relative importance of pages
web site, and it
affect the overall ranking of a web site!
Using Yahoo! Sitemaps
Yahoo!’s sitemap protocol is considerably simpler than Google’s protocol. It too supports several for-
mats including news feeds, but the format discussed here is the flat URL list plaintext file. It does not
utilize XML, nor does it ask for any information other than a list of URLs delimited by linefeeds. Yahoo!
requires that a file named
appear in the root directory of a web site, and that you register
a Yahoo! account with them.
The site must then be added at
. Arguably, Yahoo!
accomplishes some of what Google does with its simpler approach — though it does not accept informa-
tion regarding last modified dates, estimates of update frequency, or the relative importance of the pages.
Yahoo! also cannot be pinged regarding sitemap updates.
The Yahoo! sitemaps equivalent of the previously shown Google sitemap would be a file named
in the root directory of a web site with the following contents:
Like Google, using Yahoo!’s sitemap protocol will not influence a web site’s rankings, but it may get a
site spidered more quickly.
Generating Sitemaps Programmatically
It would be useful to have a library that can create Yahoo! and Google sitemaps programmatically using
the same information. The exercise that follows demonstrates such a library.
You’ll create a class named
, which can store a number of links from your site, and generate the
associated Yahoo! and Google sitemap files for you. (The notion of
, as well as the basic notions of
object-oriented programming with PHP, was explained in Chapter 7, when you used it for the first time
in this book.)
Chapter 9: Sitemaps
c09.qxd:c09 10:43 203