• Resolved George

    (@giorgos93)


    Hi, I’ve enabled an option to exclude empty categories (without posts) from XML-sitemap. However, on my website I have several categories with subcategories inside. And I never choose categories for posts – I only choose subcategories. Categories are used as an empty container for subcategories.

    For example, I have a category “Randomizers”. And inside I have subcategories “Name randomizers”, “Character randomizers” etc, which have posts inside. So, Rank Math SEO automatically exludes “Randomizers” category from sitemap because it has to be empty. However, it is not empty – WordPress (or my theme?) automatically collects all posts from subcategories inside a category.

    So now the category page is not empty, but it is exluded from sitemap, because Rank Math SEO thinks it’s empty. And search crawlers try to add some categories for indexation, but they don’t find them in sitemap.

    My question: is it an expected behaviour from your plugin? Or it has to include these categories in sitemap, because they are not empty?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Jaideep Asrani

    (@jaideeprm)

    Hello @giorgos93,

    Thank you for contacting Rank Math support.

    This is the expected behavior. Themes show the posts of the subcategories on the category page, but if you check the category list in the backend, you will see that 0 posts are assigned to that category. When our plugin checks the database, it finds the same(zero posts) for the main category, and excludes it from the sitemap.

    If you want to include main categories in the sitemap, then you should include the empty categories in the sitemap.

    Please do not hesitate to let us know if you need our assistance with anything else.

    Thread Starter George

    (@giorgos93)

    Hi, @jaideeprm , thanks for the answer.

    I’ve just disabled noindex for empty categories in Rank Math SEO settings, but my categories didn’t appear in sitemap after that.

    I tried to purge my website’s cache, and I tried to flush the sitemap cache by following this instruction: https://i.rankmath.com/pipRDp , but it didn’t help. I also have this code in my functions.php (I tried to remove it and save the file, but it didn’t help as well):

    add_filter( ‘rank_math/sitemap/enable_caching’, ‘__return_false’);

    How can I return empty categories in sitemap?

    Plugin Support Rakibuzzaman Siam

    (@rakibuzzamansiam1)

    Hello @giorgos93,

    Please make sure the “Include Empty Terms” option is enabled in Rank Math > Sitemap Settings > Categories. Here’s a screenshot for your reference: https://i.rankmath.com/i/9S0mDV

    Once done, please clear your sitemap cache and check again.

    If the issue persists, please share some affected category URLs so we can investigate this further for you.

    Please let us know how it goes. We look forward to helping you further.

    Thread Starter George

    (@giorgos93)

    Hi, @rakibuzzamansiam1 , thanks for the answer. Yes, enabling “Include Empty Terms” option did help, thanks! Before, I tried another option.

    However, I noticed, that if I enable “noindex for empty categories” option, then it doesn’t work – my categories are still indexed. In my case, I need this “empty” categories to be indexed, so it’s not a problem. But just in case decided to tell you that – maybe it’s not an expected behaviour for categories without posts, which have subcategories with posts.

    Plugin Support Jaideep Asrani

    (@jaideeprm)

    Hello @giorgos93,

    That’s the expected behavior. The parent category is not set to noindex if the child category has posts. We have also asked developers to look into this and see if the same can be done with the Include Empty Terms option of the sitemap settings.

    Please do not hesitate to let us know if you need our assistance with anything else.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.