Support » Plugin: Yoast SEO » Sitemap: exclude posts from category

  • right now I can select to exclude a category from the category-sitemap.xml – which works fine.

    however, all the posts from this category are still listed in the post-sitemap.xml

    is there an option to exclude posts from a certain category as well? I think this should be an option, as I do not want to individually exclude single posts but select categories which should completely be removed from all the sitemaps.

    thanks for a hint!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Salpetriere


    I’d just like to chime in and let the good people behind Yoast know that we require this functionality also.



    As you can set several categories per post, this would be kind of difficult to implement.

    Say you have chosen to exclude category A and all the posts from category A and you have chosen to include category B and all the posts from category B.
    Now you have a post tagged with both category A and B. What should the plugin do ?

    In other words, that’s why it makes sense for this to be a setting on individual page/post level.

    Hope this helps.




    Indeed, good thinking.

    but also editors don’t really care about why posts should be excluded sometimes from the sitemap, so they won’t set it manually. some developers use categories just for logical use (i.e. “show as highlight”) but this category should not be included into the sitemap as it only affects the frontend display (yeah, i know – bad taxonomy 😉

    maybe this needs to have some advanced options:

    [X] exclude posts from sitemap, if its category is excluded
    [X] exclude posts even if in other category which is not excluded

    This way the administrator can decide the behaviour of post exclusions.



    There’s a filter for that 😉

    There’s a string of filters available for altering the output of the sitemaps, some are described here. But if you look at the /wordpress-seo/inc/class-sitemaps.php file, you’ll see there are plenty more available.

    Does that help ?


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sitemap: exclude posts from category’ is closed to new replies.