• Resolved wmiles

    (@wmiles)


    This is not necessarily a problem with your plugin, but perhaps you can explain this issue and adapt your plugin if appropriate?

    It turns out that if local modification are made to the WooCommerce product taxonomy query to hide some categories or sold out products from the Shop page then these hidden products also do not show up in your generated Sitemap.

    The modifications use actions ‘woocommerce_product_query’ or ‘pre_get_posts’.

    Products are frequently hidden for business display purposes only and should not be removed from the Sitemap unless your specific product or post ‘Exclude from XML Sitemap’ option is set.

    Is there some way that the Product post type can be accessed so as to bypass this issue and capture all products and/or posts for the Sitemap?

    Thank you for looking into this issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, be aware that if your hooks are used to make taxonomy terms or posts non-public, then indeed they will not show in the sitemap either. All urls featured there must be publicly accessible.

    That said, you might be able to use the plugin function is_sitemap in your post/tax hooks to break out in case of a sitemap request:

    
    if ( function_exists('is_sitemap') && is_sitemap() ) return;
    
    Thread Starter wmiles

    (@wmiles)

    That did the trick. Thanks for the assist.

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

The topic ‘Not all WooCommerce Products show in Sitemap’ is closed to new replies.