GET FREE VERSION GET THE PRO VERSION

How to Include Taxonomy Term Results on the Search Results Page

Learn how to display taxonomy terms results inside WooCommerce search results page.

In this article

Overview

One of the great features of the Advanced Woo Search plugin is its ability to search for and display taxonomy term results.

You can search for product categories, product tags, attributes, and any other custom taxonomies — and display them directly within the live search results.

Taxonomy terms results in live search

Taxonomy terms results in live search

Taxonomy terms results on search results page

Taxonomy terms results on search results page

But how can you display such results on the separate search results page? By default, they won’t be visible because Advanced Woo Search doesn’t create its own search results page — it simply uses the existing one to output its results.

However, there is a solution. Below, we’ll cover how to display taxonomy term results on the default WooCommerce search results page.

Solution 1: Via Page Builder

Are you using a page builder plugin like Elementor, Gutenberg, Divi, etc.?

Great news! We have detailed tutorials on how to add taxonomy term results to the search results page using many popular builders. Here’s a list:

Just go to the article for your page builder and follow the step-by-step guide.

Solution 2: Via Shortcode

Not using any page builder plugin, or just prefer a manual approach?

No problem! You can use the special [aws_taxonomy_terms_results] shortcode to display taxonomy term results.

Note: This shortcode must be added to the WooCommerce search results page. It won’t return results if placed on other pages.

Here’s how to add it:

  1. 1. Figure out how to insert a shortcode into your search results page.

    This depends on your theme. For example, if your theme has a widget area at the top of the search results page, just add a Text widget there. Then, inside the Text widget content field, insert:

    [aws_taxonomy_terms_results limit="10" columns="3" taxonomy="product_cat"]

    Text widget inside the appropriate widget area

    Text widget inside the appropriate widget area

  2. 2. Customize the shortcode parameters as needed:

    • limit – Maximum number of results to display. Use -1 for unlimited.
      Default: -1
    • columns – Number of columns in the results layout.
      Default: 4
    • taxonomy – Which taxonomy to display. Use all to show all available taxonomy terms.
      Default: 'all'

    Shortcode inside the text widget

    Shortcode inside the text widget

  3. 3. Save your widget settings and check the search results page — the taxonomy term results should now be visible in the location where you added the Text widget.

Solution 3: Via PHP Code

A more advanced method is to use PHP code and edit your theme’s template files directly.

This depends on your current WordPress theme, but in most cases, you’ll need to edit the archive-product.php template from your theme folder.

Here’s how:

  1. 1. Locate the template file.
    Open your theme folder and find archive-product.php or woocommerce/archive-product.php.

    Tip: Always edit a child theme instead of the parent theme. Changes to the parent theme will be lost after an update. If you don’t have a child theme, create one and copy archive-product.php from the parent theme into the child theme folder.

  2. 2. Open the file and find the insertion point.
    Typically, you want to display taxonomy term results before the product results. Look for:

    do_action( 'woocommerce_before_shop_loop' );

    Then, above it, add:

    echo do_shortcode('[aws_taxonomy_terms_results limit="10" columns="3" taxonomy="product_cat"]');

    Adjust the parameters (limit, columns, taxonomy) as needed.

    Code snippet inside archive-product.php

    Code snippet inside archive-product.php

  3. 3. Save the changes and visit your search results page — you should now see taxonomy term results displayed.