Support » Plugin: Better WordPress Google XML Sitemaps (support Sitemap Index, Multi-site and Google News) » Filtering out terms causes duplicate taxonomy listings

  • Jpyper


    I’m using the bwp_gxs_term_exclude filter to remove some categories from my sitemap. I copied the documentation function and changed it to just one “case” line for category and then used an array of category slugs that I wanted to filter out.

    Here is what my code is like (category slugs replaced for length:

    switch ($taxonomy)
            case 'category': return array('cat1', 'cat2', 'cat3', 'cat4','cat5', 'cat6'); break;
        return array('');

    One of these categories causes the whole taxonomy_category.xml sitemap to fail to load, timing out. I narrowed it down to cat5. If I try to just filter out cat5, it times out with a 500 error. If I try to filter out all but cat5, I start seeing duplications of sitemap links. (screenshot: )

    I tried deleting cat5 and recreating it. This caused one of my other categories (seemingly randomly) to become the one that breaks.

    I don’t have an idea of what could be going here, do you? Any other information I can give about this to help debug?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Khang Minh


    Hi Jpyper,

    Does the sitemap show up correctly if you do not use the filter? What if you filter out only cat1?



    If I’m not using the filter, the sitemap displays correctly.

    If I only filter out one category, the sitemap loads but the “problem category” is listed twice. Screenshots for example;

    This is without the filter:
    This is filtering just one category (chiropractic):
    This is filtering out 5 categories:

    In the last screenshot I noticed that it’s duplicated 2 of the categories. The “vortala-authored” category may be another “problem” category but I do not need that one filtered. If I ever try to filter out the “problem” category, the sitemap never loads and times out with a 500 error.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filtering out terms causes duplicate taxonomy listings’ is closed to new replies.