HUSKY - WooCommerce Product Filter Professional

WooCommerce Product Filter on a Custom Page or Your Homepage

You put the WooCommerce product filter on a custom page, a landing page or the homepage, and one of three things happens: the form shows but no products appear, every click jumps to the shop, or the page reloads and nothing changes. None of this is a bug. The [woof] shortcode prints only the search form, and the plugin decides where to show the results by looking at what else is on the page. Below is how that decision works and the exact shortcode setups for the common cases: filter and products on one page, a page limited to one category or attribute, and a homepage form that sends visitors to the results.

Where a WooCommerce product filter on a custom page sends visitors

When the visitor presses Filter (or changes an option with autosubmit on), the plugin's script builds a link such as ?swoof=1&pa_color=red and checks the current page for a product list it can refresh: the output of [woof_products], a WooCommerce [products] shortcode, or any .products list inside a .woocommerce container. If it finds one, the results open on the same page. If it does not, the visitor goes to the shop page, which is the page selected in WooCommerce → Settings → Products → Shop page.

What the page containsWhere the results appear
Only [woof]The shop page, with the selected filters
[woof] + [woof_products]The same page; without reload when is_ajax=1
[woof] + WooCommerce [products]The same page, after a reload
[woof redirect="..."] and no AJAX product gridThe URL in redirect
A single product page (related products do not count)The shop page, or the redirect URL

Two consequences are worth knowing before you build anything. If no Shop page is set in WooCommerce, there is nowhere to send the visitor, and the filter reloads whatever page it is on, a single product page included. And if your homepage shows any product block (featured products, a sale carousel built with WooCommerce markup), the filter treats that block as the result grid and reloads the homepage instead of opening the shop.

Filter and products on the same page

For a page that works like a small shop, place two shortcodes. They can sit in different blocks or columns, for example the form in a narrow column and the products in the wide one:

[woof]
[woof_products per_page=12 columns=3 is_ajax=1]
  • per_page: set it. Without it, [woof_products] uses Products per page from the plugin's Advanced → Options tab, and if that is -1 (the default), WordPress's Blog pages show at most setting, which is 10 on most sites.
  • columns: products per row. Whether the theme respects it depends on the theme's CSS.
  • is_ajax=1: results are replaced without a page reload, and the address bar is updated so the filtered page can be shared. With is_ajax=0 the page reloads. On a custom page this attribute is what switches AJAX on; the Try to ajaxify the shop option only affects the shop and category archives.

[woof_products] renders products with your theme's product card (the content-product.php template) and runs the standard WooCommerce loop hooks, so the result count, sorting and pagination appear as they do on the shop page.

The WooCommerce [products] shortcode is filterable too: while a filter is active, HUSKY adds its conditions to that shortcode's query. [products limit="12" columns="4" paginate="true"] next to [woof] works with page reloads; for AJAX, use the twin that HUSKY registers, [products_woof], with the same attributes.

Limit the page to one category, tag or attribute

A page for one brand, one location or "refurbished smartphones only" needs a permanent condition that visitors cannot clear. That is the taxonomies attribute, and it belongs in both shortcodes:

[woof taxonomies="product_cat:87+product_tag:105" tax_exclude="product_cat,product_tag"]
[woof_products taxonomies="product_cat:87+product_tag:105" per_page=12 columns=3 is_ajax=1]

The syntax is taxonomy:ID. Several IDs of one taxonomy are separated with commas; different taxonomies are joined with + and must all match. With the default OR logic, product_cat:87,92+pa_brand:14 means "in category 87 or 92, and brand 14", and products in child categories of 87 and 92 are included. If you switched a taxonomy to AND logic in the plugin settings, that logic applies to its IDs here too.

Term IDs, not slugs or names

The plugin converts each value to a term with the given ID. A slug such as cadeau or a name such as Yes is not an ID, matches nothing, and that part of the condition is dropped without any error, so the page shows all products. To find an ID, open Products → Categories (or Tags, or Products → Attributes → Configure terms), hover the term's Edit link and read the number after tag_ID= in the link.

The taxonomy name must be exact: product_cat, product_tag, pa_ plus the attribute slug for global attributes (pa_color, not color), or the slug of a custom taxonomy such as a brands taxonomy. Custom attributes typed directly into one product are not taxonomies and cannot be used here.

What each shortcode does with the value

  • In [woof_products] it limits the products. This is the part that does the work.
  • In [woof] it limits what the form counts: with Show count and Dynamic recount on, the numbers next to the options and the price range describe the same limited set, and with Hide empty terms options that have no products on this page disappear. In AJAX mode the form is redrawn after each filtering with the value from [woof_products], so keep the two identical or the counts change after the first click.

The condition is not in the URL; it is part of the page. Reset, or unticking everything, returns to the page and the condition is still there. Hide the blocks you prefiltered with tax_exclude (taxonomy names, comma separated), or build a short form with tax_only and by_only, for example [woof tax_only="pa_brand,pa_size" by_only="by_price"]; by_only="none" hides price, text search and other non-taxonomy filters. More combinations are in how to show different filters on different pages and the full attribute list on the [woof] shortcode page. To prefilter by a meta field instead of a taxonomy, see manipulating the search data.

A homepage filter that redirects to the shop

The robust homepage setup is a search form that sends visitors to a results page:

[woof redirect="https://example.com/shop/" autosubmit=1 ajax_redraw=1 tax_only="product_cat,pa_size" by_only="none"]
  • redirect: the results page. It can be the shop, a category archive such as https://example.com/product-category/tires/ (the results then stay inside that category, because the category is in the address), or a custom page with [woof] and [woof_products]. Use a clean URL without ?; the plugin appends ?swoof=1&... to it.
  • autosubmit=1 alone sends the visitor away on the first change, which suits a single drop-down. For a form with several fields, add ajax_redraw=1: each choice only refreshes the form (counts, dependent options), and the Filter button opens the results page. With autosubmit=0 nothing happens until the visitor presses Filter.

Rules that cause most "redirect does not work" reports:

  • Redirect is ignored in AJAX mode. If the same page also has [woof_products is_ajax=1] or [products_woof], the form filters that grid instead.
  • One page, one filter. When several forms are on a page, the script takes redirect, autosubmit and ajax_redraw from the first form it finds. A second form in a sidebar or an automatic filter above the products can silently override the form you configured. The HUSKY widget has its own Redirect to field for the same purpose.
  • A taxonomies condition on the homepage form does not travel with the redirect; only what the visitor selected goes into the URL. If the form is about one category, redirect to that category's archive.

Why not filter on the static front page itself

Filtering in place works on ordinary pages. The static front page is the exception: parameters such as product_cat or product_tag are also WordPress query variables, and when they appear on the site's root address, WordPress stops treating the request as your front page. Depending on the theme, visitors then see a category archive, an empty page, or a Page not found title added by the SEO plugin. Put the filter and [woof_products] on a normal page (for example /products/) and let the homepage form redirect there.

Show products only after the visitor filters

For a landing page that should open with the form alone, add display_on_search=1 to [woof_products]. Until a filter is applied the product area stays empty; after the first search the page shows the results. The documentation describes this attribute for reload mode, so use it with is_ajax=0. Details on the [woof_products] shortcode page.

Single product pages, menus and page builder grids

  • Single product pages. A filter in the product page sidebar always opens the shop (or its redirect URL); related and upsell products are not treated as results.
  • Menus and mega menus. Link category items to the real category archives (/product-category/.../), not to pages that hold a shortcode. Archives are filterable without any setup and keep the category while filtering.
  • Builder product grids. A grid from Elementor, Divi or another builder that runs its own product query does not react to the filter, even when the form stays on the page. Replace it with [woof_products], or make its query filterable as described in filter URL changes but products do not change.
  • [woof_products] on category templates. The shortcode does not know which category archive it is placed on; it is made for pages. On a category template it shows all products unless you pass taxonomies, so keep the standard archive product loop there.

If it still does not work

  • The quotes are straight. Shortcodes copied from a word processor or some web pages arrive with curly quotes (’pa_age’), which WordPress does not accept as attribute quotes. Retype them in a Shortcode block.
  • Every value in taxonomies is a numeric term ID, the taxonomy name is exact, there are no spaces around + or :, and both shortcodes carry the same value.
  • [woof_products] has per_page, so the page does not stop at 10 products.
  • A Shop page is selected in WooCommerce settings.
  • Only one filter form is on the page, or the first one carries the redirect you want.
  • The product grid on the page is [woof_products], [products] or [products_woof], not a builder widget with its own query.

If all of this checks out and the page still misbehaves, post the page link and both shortcodes exactly as they are in the editor on the HUSKY support forum.