Back to Community

Troubleshooting Missing WooCommerce Products in Your XML Sitemap

29 threads Sep 9, 2025 PluginXml sitemap generator for google

Content

Many users of the 'XML Sitemap Generator for Google' plugin rely on it to ensure their WooCommerce store is properly indexed by search engines. A common issue that arises is that product pages are missing from the generated sitemap. This guide will walk you through the most common causes and their solutions.

Why This Happens

By default, the plugin may not automatically include every custom post type, such as those created by WooCommerce. This is a common design choice to keep the initial sitemap clean and manageable. The good news is that the functionality to include them is almost always already built-in; it just requires a specific configuration.

How to Fix Missing WooCommerce Products

1. Enable the 'Products' Custom Post Type

The most frequent solution is to simply enable the option within the plugin's settings.

  1. Navigate to Settings > XML-Sitemap in your WordPress dashboard.
  2. Find the section labeled "Custom post types".
  3. Locate and check the box for "Include custom post type Products".
  4. Save your changes.
  5. Clear any caching plugins or server-level cache you may be using.
  6. Re-submit your sitemap to Google Search Console.

2. Check for Empty or Inactive Product Categories

In some cases, product categories or tags that are empty (have no products assigned) or are set to a draft status may not appear in their respective taxonomy sitemaps. Ensure all categories you wish to be indexed are published and contain products.

3. Verify Product and Category Visibility

WooCommerce products and categories have their own visibility settings that override the sitemap. A product set to Catalog visibility: Hidden will typically be excluded from the sitemap. If you need a hidden product to remain in the sitemap, custom code is required. The following code snippet can be added to your theme's functions.php file to force hidden products to be included (use with caution):

// Custom code to include hidden products in the sitemap
add_filter( 'sm_b_exclude', 'modify_sitemap_exclusions', 10, 3 );

function modify_sitemap_exclusions( $excluded_post_ids ) {
    // Get IDs of products with hidden visibility
    $hidden_products = get_posts( array(
        'post_type' => 'product',
        'meta_key' => '_visibility',
        'meta_value' => 'hidden',
        'fields' => 'ids',
        'posts_per_page' => -1,
    ) );

    // Remove these IDs from the exclusion list
    $excluded_post_ids = array_diff( $excluded_post_ids, $hidden_products );
    
    return $excluded_post_ids;
}

4. Investigate Plugin Conflicts

Conflicts with other plugins, particularly other SEO or sitemap plugins, can prevent products from appearing. To test for a conflict:

  1. Temporarily deactivate all other plugins except for WooCommerce and 'XML Sitemap Generator for Google'.
  2. Check if your products now appear in the sitemap.
  3. If they do, reactivate your plugins one by one to identify the culprit.

5. Ensure You Are Using a Supported Version

Full WooCommerce support for products, categories, and tags was added in version 4.1.5 of the plugin. If you are using an older version, you must update to the latest version to access this functionality.

When to Look Elsewhere

If you have followed all the steps above and your products are still missing, the issue might be more complex. Some user reports indicate that multi-word custom post type slugs (e.g., 'for-example') can sometimes cause issues, though this is not consistent. In these rare cases, the problem is likely a bug that would need to be addressed by the 'XML Sitemap Generator for Google' team in a future update.

By methodically working through these steps, you should be able to resolve the issue and get your valuable product pages included in your sitemap for search engines to crawl.

Related Support Threads Support