Contents
Requirements
- WordPress 6.9 or higher
- PHP 7.4 or higher
- WooCommerce conditions require WooCommerce to be installed and active
Installation
- Download Plugin
- In your admin panel, go to Plugins > and click the Add New button.
- Click Upload Plugin and Choose File, then select the Plugin’s .zip file. Click Install Now.
- Click Activate to use your new Plugin right away.
Features
- Show only when — display a widget only on specific pages or conditions
- Hide when — suppress a widget on specific pages or conditions
- Always show — default behaviour, no filtering applied
- Condition-based rules — uses standard WordPress and WooCommerce conditional functions
- URL-based rules — match exact paths or use wildcards like
/documentation/* - Works across all widget areas — sidebar, header, footer, and all other registered widget positions
Installation
- Download or clone this repository into your
/wp-content/plugins/directory - Activate the plugin via Plugins → Installed Plugins in the WordPress admin
- Go to Appearance → Widgets and click any block widget to see the Widget Visibility panel in the right sidebar
Usage
Setting a visibility rule
- Open Appearance → Widgets
- Click the widget you want to control
- In the right sidebar, find the Widget Visibility panel
- Choose a rule from the Visibility rule dropdown:
Always show— widget is always visible (default)Show only when…— widget is visible only when a condition or URL matchesHide when…— widget is hidden when a condition or URL matches
- Add conditions and/or URLs to the respective fields
- Click Update to save
Conditions
Enter one condition per line. The widget rule triggers if any condition is true (OR logic).
is_product_category()
is_shop()
is_search()
Available conditions:
| Condition | Description |
|---|---|
is_front_page() | Front page |
is_home() | Blog index |
is_singular() | Any single post, page, or CPT |
is_single() | Single post |
is_page() | Static page |
is_archive() | Any archive |
is_category() | Category archive |
is_tag() | Tag archive |
is_author() | Author archive |
is_date() | Date archive |
is_search() | Search results |
is_404() | 404 page |
is_user_logged_in() | Logged-in users |
is_woocommerce() | Any WooCommerce page |
is_shop() | WooCommerce shop page |
is_product() | Single product page |
is_product_category() | Product category archive |
is_product_tag() | Product tag archive |
is_product_taxonomy() | Any product taxonomy |
is_cart() | Cart page |
is_checkout() | Checkout page |
is_account_page() | My Account page |
URLs
Enter one path per line. Wildcards (*) are supported. The widget rule triggers if any URL matches (OR logic).
/documentation/
/documentation/*
/shop/*
Use relative paths only — no domain needed. The path is matched against the current
REQUEST_URI.
Combining conditions and URLs
Conditions and URLs work together with OR logic — the rule triggers if either a condition OR a URL matches. This means you can mix both fields freely:
Conditions: is_shop()
URLs: /documentation/*
The widget will be shown (or hidden) on the shop page AND on all documentation pages.
Known Limitations
- Custom HTML blocks (
core/html) are not currently supported. The Widget Visibility panel will appear, but settings will not be applied on the frontend. As a workaround, wrap your Custom HTML block inside a Group block and apply the visibility rule to the Group instead.
License
MIT License — see LICENSE for details.