|
Location: Web development - PHP License: The GNU General Public License (GPL) Generating XML Sitemap what support Google, Yahoo and MSNPosted by Constantin BotnariGenerating XML Sitemap what support Google, Yahoo and MSN |
Skill: BeginnerPosted: 26/11/2008Views: 570Rating: 0.00 /5Popularity: 0.00 |
| Sign Up to vote for this article |
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.
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:
I think this code will be useful for someone who want to improve the access from search engines to their web pages.
I think this code will be useful for someone who want to improve the access from search engines to their web pages.
This article, along with any associated source code and files, is licensed under The GNU General Public License (GPL)
| Constantin Botnari
| Location: |
Sign up to post message on the article message board!