---
title: Filter single product category array using %%wc_single_cat%%
url: "https://www.seopress.org/support/hooks/filter-single-product-category-array-using-wc_single_cat/"
lang: en-US
updated: 2021-09-30
hook_name: seopress_titles_product_cat
required_version: 3.7.2
---

# Filter single product category array using %%wc_single_cat%%

- **Hook name:** `seopress_titles_product_cat`
- **Required version:** 3.7.2

```php
add_filter('seopress_titles_product_cat', 'sp_titles_product_cat');
function sp_titles_product_cat($cat) {
	//$cat = array of single product category, key = term ID, value = term name
	unset($cat[20]); //remove category with term ID "20",
	return $cat;
}
```

Source: [https://gist.github.com/wp-seopress/02f7aac07eb02f85882aceac3914d582](https://gist.github.com/wp-seopress/02f7aac07eb02f85882aceac3914d582)



