Navigating WooCommerce Category Displays: A Guide for Parent/Subcategory Structures

WooCommerce, while powerful, can sometimes present new store owners with intricate challenges, especially when it comes to structuring product displays. A recent discussion in the WordPress support forums, titled "Categories and Subcategories", perfectly illustrates a common hurdle: correctly displaying parent categories as lists of subcategories rather than a direct dump of all products.

The user, new to WordPress and coding, described a scenario where their parent categories, intended to show a list of their respective subcategories, instead displayed all products contained within those subcategories. This created a confusing user experience, bypassing the desired hierarchical navigation. They had set parent categories to a "Subcategories" display type and subcategories to "Default", and were using the [product_categories number ="0" parent="0"] shortcode on their Product Catalogue page. Yet, the outcome was not as expected.

Understanding the WooCommerce Category Display Problem

The core of the issue lies in how WooCommerce interprets and renders category archive pages based on specific settings and theme templates. When a user clicks on a category link, they are taken to that category's archive page. What appears on this page – a list of subcategories, a grid of products, or both – is primarily governed by the "Display type" setting for that particular category in the WooCommerce backend.

The forum user's observation that "when you click through it shows the parent category with all items in all subcategories displayed and not a subcategories list to click on to show just the items in that category" directly contradicts their stated setup of parent categories having a "display type of subcategories". This suggests either a misapplication of the setting, a theme overriding the default WooCommerce behavior, or a caching issue.

The Power of WooCommerce's "Display type" Setting

WooCommerce provides a crucial setting for each product category that dictates its archive page's content. This setting is found when you edit a product category under Products > Categories. The "Display type" dropdown offers several options:

  • Products: This option will display all products assigned directly to this category, as well as products assigned to any of its subcategories. This is often the default behavior and what the user was experiencing unintentionally on their parent category pages.
  • Subcategories: This is the key setting for achieving the desired hierarchical navigation. When selected, the category archive page will only display a list of its immediate child categories, allowing users to drill down further. Products will not be shown on this page.
  • Both: As the name suggests, this option displays both products (from the current category and its children) and a list of immediate subcategories.
  • Default: This option defers to your theme's settings or WooCommerce's global defaults. Often, "Default" resolves to "Products" or "Both", depending on your theme, which can contribute to the confusion if not explicitly set.

Solving the Parent/Subcategory Display Conundrum: Step-by-Step

To resolve the issue faced by the forum user and establish a clear parent-subcategory navigation, follow these detailed steps:

1. Verify Your Category Hierarchy

Before adjusting display types, ensure your categories are correctly structured with parent-child relationships:

  • Navigate to Products > Categories in your WordPress dashboard.
  • Observe the indentation. Categories indented under another are its subcategories. For example, "Men's" and "Women's" should be indented under "Clothing" if they are subcategories.
  • If your hierarchy is incorrect, edit the subcategories and select the appropriate parent category from the "Parent category" dropdown.

2. Configure Parent Category Display

For your top-level categories (the ones you want to show a list of subcategories), apply the correct display setting:

  • Go to Products > Categories.
  • Click "Edit" on each of your main parent categories (e.g., "Clothing", "Electronics").
  • Scroll down to the "Display type" dropdown.
  • Select "Subcategories".
  • Click the "Update" button to save your changes.

3. Configure Subcategory Display

For your actual subcategories (the ones that should list products), ensure they are set to display products:

  • Go to Products > Categories.
  • Click "Edit" on each of your subcategories (e.g., "Men's", "Laptops").
  • Scroll down to the "Display type" dropdown.
  • Select "Products" or "Default" (if you are confident your theme's default for these is products). "Products" is generally safer for explicit control.
  • Click the "Update" button to save your changes.

4. Implement the Product Categories Shortcode

The shortcode provided in the forum topic is correct for listing top-level categories. Ensure it's placed on your desired Product Catalogue page:

 !-- wp:shortcode -- product_categories number ="0" parent="0"] !-- /wp:shortcode -- 

This shortcode, when rendered, will display links to your top-level categories. The number="0" attribute means show all categories, and parent="0" means show only top-level categories (those with no parent).

5. Test Your Setup

After making these changes, it's crucial to test your store's navigation:

  • Visit your "Product Catalogue" page where the shortcode is located. You should see a list of your main parent categories.
  • Click on one of these parent categories. You should now be taken to its archive page, which displays a list of its immediate subcategories, not products.
  • Click on a subcategory. This page should then display all the products assigned to that specific subcategory.

6. Troubleshooting (If the issue persists)

If you're still not seeing the desired behavior, consider these common culprits:

  • Theme Overrides: Many themes come with their own custom WooCommerce templates that can override the default display settings. Check your theme's documentation or customization options for category archive layouts.
  • Plugin Conflicts: Other plugins, especially those related to custom product displays, filtering, or page builders, might interfere. Try temporarily deactivating other plugins to isolate the issue.
  • Caching: Caching plugins (e.g., WP Super Cache, LiteSpeed Cache, W3 Total Cache) and your browser's cache can prevent you from seeing immediate changes. Clear all caches after making updates.

Beyond Basic Setup: Enhancing Your Category Pages

Once the fundamental display logic is in place, developers and advanced users might consider further enhancements:

  • Customizing Archive Templates: For granular control, you can override WooCommerce's default templates by copying them to your theme's woocommerce folder (e.g., archive-product.php, taxonomy-product_cat.php). This requires coding knowledge.
  • Page Builders: Tools like Elementor or Beaver Builder offer modules to design custom category archive layouts, providing more visual control without deep coding.

Conclusion

The forum discussion highlights a common initial roadblock for new WooCommerce users: understanding the distinction between displaying category links and controlling the content of category archive pages. By correctly utilizing the "Display type" setting for each product category and understanding the role of the [product_categories] shortcode, store owners can establish a clear, intuitive navigation structure that enhances the shopping experience. Always remember to test thoroughly and consider theme/plugin interactions when troubleshooting display issues.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools