WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Google XML Sitemaps] Custom Taxonomies Support (18 posts)

  1. Luciano Passuello
    Member
    Posted 5 years ago #

    I am coding a new website, and I am making use of custom taxonomies.

    I have a products review site, and I created a 'brand' taxonomy. Under this taxonomy, I have terms 'Brand A', 'Brand B' and so on.
    Wordpress automatically generates archive pages for each term in the taxonomy:

    http://site.com/brand/brand-a/
    http://site.com/brand/brand-b/
    and so on.

    But these pages do not get included in the sitemap.

    I believe this should be added as soon as possible, since custom taxonomies is now a core feature of WordPress.

  2. Justin Tadlock
    Member
    Posted 5 years ago #

    Custom taxonomies have been a core feature of WordPress since 2.3. This should've been added to the plugin long ago.

  3. Luciano Passuello
    Member
    Posted 5 years ago #

    I'd like to hear from the plugin author what's the status on this.
    Arne, are there any plans to implement custom taxonomies in the sitemaps plugin?

    Thanks in advance!

  4. Lee Willis
    Member
    Posted 5 years ago #

    Just to add my vote to this. My scenario is pretty much the same as the original poster - however I have 2 custom taxonomies. It would be great if you could select these individually in the "Sitemap Content" section of the options.

    So - is the author considering adding this, and if not, would you consider a patch if I can implement it?

  5. Lee Willis
    Member
    Posted 5 years ago #

    Right-ho. I've implemented this for one of my sites. I you're interested, you can find the patch here:

    http://www.leewillis.co.uk/patches/google-sitemap-generator/include_taxonomies.txt

    It hasn't undergone rigorous testing, but it "works for me" :)

    I'll try and get this included in the base release as well.

  6. Lee Willis
    Member
    Posted 5 years ago #

  7. Luciano Passuello
    Member
    Posted 5 years ago #

    Hi Lee,

    Awesome! Thanks for sharing your work --- I voted for the feature on UserVoice, now let's hope it gets included!

    As for the patch, I'm eager to test it in my local environment, but I don't know how to integrate it in my local copy (I'm using TortoiseSVN). It complains about /new and /old directories...

    How can I make it work? (Or maybe you can share the final versions of the .php files?)

  8. Lee Willis
    Member
    Posted 5 years ago #

    If you have a UNIX box, then use the -p1 argument with patch, e.g.

    $ cd wp-content/plugins/
    $ patch -p1 < path.to.my.patch.file

    Should do it. Failing that, just grab the following two files, and put them into wp-content/plugins/google-sitemap-generator/

    http://www.leewillis.co.uk/patches/google-sitemap-generator/sitemap-core.php
    http://www.leewillis.co.uk/patches/google-sitemap-generator/sitemap-ui.php

    As I mentioned previously though - this has only been tested on my site, and while it seems to work - I can't guarantee it will work on yours - so please take a backup of sitemap-core.php and sitemap-ui.php before you start!

    Let me know how you get on

  9. Luciano Passuello
    Member
    Posted 5 years ago #

    Hi Lee,

    I managed to get the patch working on my local box by overriding the files you provided, It worked flawlessly! Thank you so much!

    I also dropped a comment in the UserVoice feature request that the patch works just fine.

    Thanks again! :)

  10. Lee Willis
    Member
    Posted 5 years ago #

    Glad it works for you!

  11. Lee Willis
    Member
    Posted 5 years ago #

    I've emailed the author to try and get it included upstream - fingers crossed!

  12. Lee Willis
    Member
    Posted 4 years ago #

    I've updated the patch to match the new version 3.1.5.

    It's in the comments at http://www.leewillis.co.uk/custom-taxonomies-wordpress-plugins/

  13. arnee
    Member
    Posted 4 years ago #

    Hi,

    the last version was more a bug fix release which addressed the most annoying issues. I will have more time for the next version and will try to include your patch. Thanks!

  14. Lee Willis
    Member
    Posted 4 years ago #

    I've updated the patch against 3.1.6, and also made it generate a modification time based on the the last update time of an article tagged with that taxonomy term.

    The revised patch is here:

    http://www.leewillis.co.uk/patches/google-sitemap-generator/include_taxonomies_v3.1.6.txt

  15. arnee
    Member
    Posted 4 years ago #

    Hi Lee,

    Thanks for your patch! I've integrated it into the new release (with some small changes) :-)

  16. Lee Willis
    Member
    Posted 4 years ago #

    Thanks!

  17. Lee Willis
    Member
    Posted 4 years ago #

    Hi Arnee - one of your changes broke modification times - it only shows the modification time for the most recently updated term within a taxonomy.

    Fortunately the fix is simple - just add the following to the end of the $lastMods query on line 2198:

    "GROUP BY r.term_taxonomy_id"

    3.1.8 here we come :)

  18. arnee
    Member
    Posted 4 years ago #

    Hi,

    thanks for the note! Actually I rewrote the whole part already using only one statement for everything (all taxonomies, terms, lastmod. and so on). ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic