WordPress.org

Forums

Google Sitemap (56 posts)

  1. dyn4mik3
    Member
    Posted 9 years ago #

    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!

  2. Ozh
    Member
    Posted 9 years ago #

    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 :)

  3. raianoat
    Member
    Posted 9 years ago #

    Great job! I was hoping that somebody would do this.

    Thanks!
    Alex

  4. dsas
    Member
    Posted 9 years ago #

    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

  5. m4c3w4n
    Member
    Posted 9 years ago #

    dsas, I modded it further to combine
    categories & gzipping

  6. rshupe
    Member
    Posted 9 years ago #

    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.

  7. johanvanderwijk
    Member
    Posted 9 years ago #

    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 :)

  8. elyonline
    Member
    Posted 9 years ago #

    so do you just add the PHP file to the root of WP?

    Thanks

  9. johanvanderwijk
    Member
    Posted 9 years ago #

    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).

  10. elyonline
    Member
    Posted 9 years ago #

    OK thanks a lot :)

  11. raianoat
    Member
    Posted 9 years ago #

  12. angsuman
    Member
    Posted 9 years ago #

    How about creating a plugin :)

  13. TheodorRamisch
    Member
    Posted 9 years ago #

    Have a look at arnebrachhold.de. Supports categories, archives, static pages and has a priority calculation for posts.

  14. Lorelle
    Member
    Posted 9 years ago #

    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.

  15. Sidney440
    Member
    Posted 9 years ago #

    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

  16. kickass
    Member
    Posted 9 years ago #

    I think this thread should be either stickeyed or put in the Codex, folks.

  17. dyn4mik3
    Member
    Posted 9 years ago #

    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.

  18. Arne Brachhold
    Member
    Posted 9 years ago #

    Hi there,

    if you want you can try the beta of my new generator script, which comes as a WordPress plugin. Check http://www.arnebrachhold.de for details. Features static file generation, posts, pages, archives, categories and has a graphical configuration page.

    Greets,

    Arne

  19. Aleister
    Member
    Posted 9 years ago #

    Just installed the one from arnebrachhold.de. It is working great :)

  20. toms
    Member
    Posted 9 years ago #

    not working... getting link to wordpress and firefox
    Help?

  21. Aleister
    Member
    Posted 9 years ago #

    Which one are you trying to install?

  22. kickass
    Member
    Posted 9 years ago #

    Wow. It's codexed already! You guys rock. Really.

  23. g0nk
    Member
    Posted 9 years ago #

    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

  24. hooopla
    Member
    Posted 9 years ago #

    Have you activated the plugin?

  25. g0nk
    Member
    Posted 9 years ago #

    yeah, it's activated.

  26. toms
    Member
    Posted 9 years ago #

    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.

  27. argentine
    Member
    Posted 9 years ago #

    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

  28. tonyzeoli
    Member
    Posted 9 years ago #

    This works great for me! Thanks so much for creating this plug-in Arne! Great work!

    Tony Z

  29. g0nk
    Member
    Posted 9 years ago #

    update: I upgraded to WP 1.5.1.2 and it works fine now.

  30. Arne Brachhold
    Member
    Posted 9 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic