I whipped up a php script to generate a Google Sitemap from all posts. I'm not sure if it will work on all Wordpress sites since I only have access to mine.
If anyone can improve on this please do!
I whipped up a php script to generate a Google Sitemap from all posts. I'm not sure if it will work on all Wordpress sites since I only have access to mine.
If anyone can improve on this please do!
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).
OK thanks a lot :)
Works great! Just added mine:
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.
I'll be working on a plugin throughout the week - but I'm wondering if someone else will get it going before me =P Thanks for the comments and all the improvements. This is why the Wordpress community rocks.
Hi there,
if you want you can try the beta of my new generator script, which comes as a WordPress plugin. Check www.arnebrachhold.de for details. Features static file generation, posts, pages, archives, categories and has a graphical configuration page.
Greets,
Arne
Just installed the one from arnebrachhold.de. It is working great :)
not working... getting link to wordpress and firefox
Help?
Which one are you trying to install?
Wow. It's codexed already! You guys rock. Really.
doesnt seem to work for me. I installed the plugin, but there is nothing coming up at all for the options > sitemap page.
using the final v2 at: http://www.arnebrachhold.de/2005/06/05/google-sitemap-generator-v2
Have you activated the plugin?
yeah, it's activated.
I'm trying to install Arne's plugin, but there is nothing in the options-> sitemap page other then links to firefox and this forum. I do have in the wp derectory a sitemap.php file as a stand alone ( not a plugin), which should not really interfere with the plugin function I guess. I am not sure what else to do to make the plugin work.
Problem with safe mode when rebuilt
Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid is 2511 is not allowed to access /webcp/docs/webs/5356312447/blog owned by uid 0 in /webcp/docs/webs/5356312447/blog/wp-content/plugins/sitemap.php on line 542
Warning: fopen(/webcp/docs/webs/5356312447/blog/sitemap.xml): failed to open stream: No such file or directory in /webcp/docs/webs/5356312447/blog/wp-content/plugins/sitemap.php on line 542
Warning: fwrite(): supplied argument is not a valid stream resource in /webcp/docs/webs/5356312447/blog/wp-content/plugins/sitemap.php on line 543
Warning: fclose(): supplied argument is not a valid stream resource in /webcp/docs/webs/5356312447/blog/wp-content/plugins/sitemap.php on line 544
This works great for me! Thanks so much for creating this plug-in Arne! Great work!
Tony Z
update: I upgraded to WP 1.5.1.2 and it works fine now.
Hi,
thanks to all who are using my plugin :)
There is again an updated version on my site which has several new features and fixes some bugs.
Currently it's only working with WordPress 1.5.1.1 or better. If a WordPress developer or expert knows how to get the admin page working in earlier versions (1.5) please drop me a mail or comment on my site. I thinks it's a problem with the add_options_page() method which has a different behavior in 1.5.
If you get permission errors make sure that the script has writing rights in your blog directory. Try to create the sitemap.xml resp. sitemap.xml.gz at manually and upload them with a ftp program and set the rights with CHMOD. Then restart sitemap generation on the administration page.
A good tutorial for changing file permissions can be found on the WordPress Codex.
Regards,
Arne
This topic has been closed to new replies.