intelliproject logo

Location: Web development - PHP    License: The GNU General Public License (GPL)

Generating XML Sitemap what support Google, Yahoo and MSN

Posted by Constantin Botnari

Generating XML Sitemap what support Google, Yahoo and MSN

Skill: Beginner

Posted: 26/11/2008

Views: 570

Rating: 0.00 /5

Popularity: 0.00

Sign Up to vote for this article

Introduction

This is a XML Sitemap which is supposed to be processed by search engines like Google, MSN Search and YAHOO. You can find more information about XML sitemaps on sitemaps.org and Google's list of sitemap programs. 

Using the code

An submited url for search engines looks like this line of code:

Where tag <loc> are web page url what would be indexed by search engine.  The <lastmod> tag tells search engines the date when this document was modified. And tag <changefreq> tells search engines about change frequency of document. With <priority> tag we can change the priority for indexing, accepted values are between 0 and 1 (ex: 0.1, 0.6).

XML header is:

So let’s try to generate with PHP this XML file. I will write a class for that.

Here is an example how to use this class.

If we have an multiple urls stored into an array so the code will be:

Points of Interest

I think this code will be useful for someone who want to improve the access from search engines to their web pages.

Conclusion

I think this code will be useful for someone who want to improve the access from search engines to their web pages.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPL)

About the author

Constantin Botnari

Location: Moldova, Republic of
Ocupation: Software Engineer

Sign up to post message on the article message board!