WordPress.org

Ready to get started?Download WordPress

Forums

Better WordPress Google XML Sitemaps (with sitemapindex, multi-site and Google News sitemap support)
Filtering out terms causes duplicate taxonomy listings (3 posts)

  1. Jpyper
    Member
    Posted 1 year ago #

    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: http://d.pr/i/Vqi4 )

    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?

    http://wordpress.org/extend/plugins/bwp-google-xml-sitemaps/

  2. Khang Minh
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jpyper,

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

  3. Jpyper
    Member
    Posted 1 year ago #

    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: http://d.pr/i/Gvxm
    This is filtering just one category (chiropractic): http://d.pr/i/qUwX
    This is filtering out 5 categories: http://d.pr/i/afht

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic