Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/ymikimonokia/ymk-hidden-cats/archive/refs/heads/master.zipUpdates itself. It ships its own updater, so new versions appear under Dashboard → Updates.
Hides WooCommerce product categories on the frontend: shop loop, widgets and get_terms(). Does not affect admin, REST API, AJAX or direct category URLs.
Exposes a public API so other plugins (ymk-search, ymk-woo-extra) can read the hidden categories configuration without duplicating settings.
Requirements
- WordPress 5.8+
- PHP 7.4+
- WooCommerce
Installation
- Upload
ymk-hidden-catsto/wp-content/plugins/ - Activate through Plugins
- Go to Settings → YMK Hidden Cats and select the categories to hide
Public API
Other plugins consume these functions with a function_exists guard:
// Returns array of hidden category slugs
if ( function_exists( 'ymk_hidden_cats_get_slugs' ) ) {
$slugs = ymk_hidden_cats_get_slugs();
}
// Returns whether to include children of hidden categories
if ( function_exists( 'ymk_hidden_cats_include_children' ) ) {
$include = ymk_hidden_cats_include_children();
}
Compatibility
If ymk-woo-extra is active and has its own hidden cats configuration (ymk_extra_hidden_cats), this plugin reads it as fallback when its own option is empty. Migration is seamless.
Options
| Option | Default | Description |
|---|---|---|
ymk_hidden_cats_slugs |
[] |
Array of product category slugs to hide |
ymk_hidden_cats_include_children |
1 |
Also hide subcategories of hidden categories |
Changelog
See CHANGELOG.md