Arne Brachhold

WordPress Sitemap Generator for Google

Filed under: Sitemaps — arne on June 5, 2005

Google announced yesterday a new tool for webmasters. The Google Sitemaps! You can submit you sitemap to Google and allow them to find all your pages without crawling every link. You can read more about this cool feature at searchenginewatch.com.

I created a small php file which will do the generation of the sitemap in a Google compliant format for you. At the moment, only posts, home page and static pages are supported. If you have better knowledge of WordPress than me, feel free to modify the script and include category pages etc.

Every URL in the sitemap may have a priority which represents the page priority on your website. My script calculates the it on the number of comments. This should be ok for most blogs, maybe i will add the post date to priority generation later.

Installation is easy! Just download the sitemap.php and place it in your blog directory. Then tell Google Sitemaps the URL and all should be fine :)

If you want you can alter the default configuration for various settings like the change frequenty of posts etc. Just have a look at the top of the php file.

I’ve tested it on this site ( WP1.5.1.1 ) and with a XML Schema validator. If you find an error or if it doesn’t work on your site, please drop me a mail or write a comment and I will have a look at your site.

UPDATE:
I included support for archive pages. Just download the new version 1.1 again. :)
Archive pages will have a predefined priority which can be customized.

UPDATE 2:
It get’s allmost complete ;)
Added support for categorie pages. They will also habe a predefined priority which can be customized.
Download the current version at the links above.

Suggestions / Todo
- Autogenerate priority of categories (maybe by postcount?)
- Use correct lastMod in categories and archives (find last post)

UPDATE 3:
Check the beta of the new version at Google Sitemap Generator v2 (BETA) which comes as a WordPress Plugin and a grahpical administration page!

12 Comment(s)

Comment by Marcy S

Posted on June 5, 2005

Hey,

nice work. Category support would be great! Maybe I could do it for you. I will comment back later.

Regards,
Marcy

Comment by Undertaker

Posted on June 5, 2005

Works fine for me! :)

A parameter to disable priority calculation would be nice because I didn’t activate comments.

Comment by Dean Sas

Posted on June 5, 2005

I’ve created something similar, my code is probably a little more dirty than yours, I didn’t use the priority generation method you did either, I’ve got category generation though, it was quite simple to add. Take a look my sitemap generator

Comment by arne

Posted on June 5, 2005

Well Done, Dean Sas!

Maybe I will include Category support too, looks not too complicated. :)

Edit: done…

Greets,

arne

Comment by Tomas De Aquino

Posted on June 5, 2005

Works like charm!

Comment by Sidney

Posted on June 5, 2005

I merged your script with the one by Michael Nguyens, so that the final script also has gzip and only generates if necessary (it does a backup to a certain file, and if nothing has changed, only the backup is returned.). Also I changed the configuration a bit.
Hope, you’re okay with this.

Download at http://sidney.ws4f.us/2005/06/04/keeping-pace-with-google

Sid

Comment by arne

Posted on June 5, 2005

If you want you can try the beta of version 2, which includes full WordPress plugin support.

Comment by june6

Posted on July 15, 2005

I have written a language mo file for Chinese-simp.
How to upload it for you?

Comment by arne

Posted on July 15, 2005

Hi june6,

many thanks! Just send it to himself [at] arnebrachhold [dot] de and i will include it on my site :)

Comment by june6

Posted on July 15, 2005

OK, I sent it to you just now, pls check it. :-)

Comment by ken

Posted on September 7, 2005

yes,thanks a lot……..

—————————
http://www.arcino.com

Comment by Ravi

Posted on February 11, 2006

Arne,

I have been trying Google Sitemp plugin 3.0b1 for last 7 days, and I keep on getting unsupported format. do you have any idea to solve this issue.

Thanks

8 Trackbacks

Sorry, the comment form is closed at this time.

 


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser