Nice ! I was to start a thread on this topic and I saw you were quicker than me 🙂
Your script works fine, at least with all my (tests and real) blogs. I already have a few suggestions that I posted on your site. I’m sure Google Sitemap will be largely adopted by the WP community and there is a lot of space left for improvements. Your script is a very nice start on this matter. Thanks again 🙂
Great job! I was hoping that somebody would do this.
Thanks!
Alex
I’ve just came here to see if anyone had done this so I could get it, thanks dyn4mik3.
I’ve modified your code to include categories in sitemaps too
dsas, I modded it further to combine
categories & gzipping
I ended up with a very similar solution to achive Google Sitemaps for WordPress. The only addition functionality wise is that mine adds the <lastmod> element to the category output.
To also include the static pages to the XML output, I modified the query from the first script in this thread to this:
SELECT * FROM $wpdb->posts WHERE post_status = 'publish' OR post_status = 'static' ORDER by post_modified DESC
Works perfectly 🙂
so do you just add the PHP file to the root of WP?
Thanks
Yes, you can just add the PHP file to the root of WP and then give this as the location in the “Enter your Sitemap URL below” form.
Note that the example is in the form of http://www.google.com/sitemap.xml, but you will have to use something like http://www.google.com/sitemap.php (php filename extension).
How about creating a plugin 🙂
Have a look at arnebrachhold.de. Supports categories, archives, static pages and has a priority calculation for posts.
Wow, this is amazingly fast. I tested two of the mentioned php files and I had two different results, but all that was involved was copying the code from the screen and pasting it into a text file which I saved as a php file and uploaded to my root directory or just uploading the a php file to the root directory (came ready to go). I then viewed the saved file name in my browser to compare, they looked fine, and I submitted both to Google’s Site Maps link.
Took under five minutes, including reading the instructions and all.
Very quick. Thanks to all who have written scripts to make this easy for us.
Well, after some time, I finally somehow merged both plugins (Arne Brachhold’s and Michael Nguyen’s) so that all the best things are included ;-).
This includes configurability, gzip compression, pages, and only generating when necessary.
See http://sidney.ws4f.us/2005/06/04/keeping-pace-with-google
Sid
I think this thread should be either stickeyed or put in the Codex, folks.