Àpèjúwe
Category Children Coupons for WooCommerce provides a complete replacement for WooCommerceÌtumọ̀ Yorùbá: ’s built-in coupon category restrictions with additional flexibility:
Include children mode: Select a parent category and all its subcategories are automatically included. With WooCommerceÌtumọ̀ Yorùbá: ’s default restrictions, selecting “Clothing” only matches products directly in that category Ìtumọ̀ Yorùbá: – not products in “T-Shirts” or “Trousers” subcategories. This plugin includes the entire category tree.
Exclude children mode: Match only the specific categories you select, without including subcategories. This mirrors WooCommerceÌtumọ̀ Yorùbá: ’s built-in behavior but is managed within this pluginÌtumọ̀ Yorùbá: ’s unified interface.
Future-proof coupons: The plugin stores your category selection and dynamically expands child categories at validation time Ìtumọ̀ Yorùbá: – new subcategories are automatically included (or excluded) without editing existing coupons.
Features
- Four category restriction fields for complete control:
- Product categories (incl. children) Ìtumọ̀ Yorùbá: – allowed categories with all descendants
- Exclude categories (incl. children) Ìtumọ̀ Yorùbá: – blocked categories with all descendants
- Product categories (excl. children) Ìtumọ̀ Yorùbá: – allowed categories only, no descendants
- Exclude categories (excl. children) Ìtumọ̀ Yorùbá: – blocked categories only, no descendants
- Automatic subcategory handling based on your preference
- Works alongside WooCommerceÌtumọ̀ Yorùbá: ’s other (non-category coupon) restrictions
- Customizable error messages via filter
- AutomateWoo compatibility Ìtumọ̀ Yorùbá: – category restrictions are copied when generating coupons from templates
How It Works
When you select a category in an “(incl. children)” field, the plugin automatically includes all subcategories during validation. When you use an “(excl. children)” field, only the exact categories you select are matched. Selected categories with children included are validated at usage time, so the current children are automatically used, even if they have changed since the coupon was set up.
Filters
runthings_category_children_coupons_error_message
Customize the error message shown when a coupon fails category validation.
Parameters:
$message(string) Ìtumọ̀ Yorùbá: – The default error message.$context(array) Ìtumọ̀ Yorùbá: – Contains ‘coupon’ (WC_Coupon object) and ‘type’ (‘allowed’, ‘excluded’, ‘allowed_excl’, or ‘excluded_excl’).
Example:
See readme.md on GitHub for detailed code examples.
Additional Notes
Built by Matthew Harris of runthings.dev, copyright 2025.
Visit runthings.dev for more WordPress plugins and resources.
Contribute or report issues at the GitHub repository.
Icon Ìtumọ̀ Yorùbá: – Discount by Gregor Cresnar, from Noun Project, https://thenounproject.com/browse/icons/term/discount/ (CC BY 3.0)
Icon Ìtumọ̀ Yorùbá: – Tree view by Paweł Gleń from Noun Project, https://thenounproject.com/browse/icons/term/tree-view/ (CC BY 3.0) Ìtumọ̀ Yorùbá: – https://thenounproject.com/icon/tree-view-3894745/
Àwọn àwòrán ìbòjú

The category restriction fields in the coupon Usage restriction tab. 
A percentage coupon correctly applied only to products in the allowed category. 
A product from an excluded category shows no discount applied. 
Warning notice when both WooCommerceÌtumọ̀ Yorùbá: ’s built-in and this pluginÌtumọ̀ Yorùbá: ’s category fields are used together.
Ìgbéwọlẹ̀
- Upload the plugin files to the
/wp-content/plugins/runthings-category-children-couponsdirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the ‘Plugins’ screen in WordPress.
- Go to Marketing > Coupons and edit or create a coupon.
- In the “Usage restriction” tab, you will see four new category fields Ìtumọ̀ Yorùbá: – two with “(incl. children)” and two with “(excl. children)” labels.
FAQ
-
How does this differ from WooCommerceÌtumọ̀ Yorùbá: ’s built-in category restrictions?
-
WooCommerceÌtumọ̀ Yorùbá: ’s built-in “Product categories” field only matches products directly assigned to the selected categories.
This plugin provides both options: “(incl. children)” fields automatically include all subcategories, while “(excl. children)” fields match only the exact categories you select Ìtumọ̀ Yorùbá: – giving you complete control.
-
Can I use both this pluginÌtumọ̀ Yorùbá: ’s fields and WooCommerceÌtumọ̀ Yorùbá: ’s built-in category fields?
-
Not recommended. The built-in category check runs before custom plugin checks. They operate as separate restrictions (AND logic). If you use both, a coupon must first pass the built-in category rules, which may cause unexpected results.
This plugin provides “(excl. children)” fields that mirror WooCommerceÌtumọ̀ Yorùbá: ’s built-in behavior, so you can use this plugin as a complete replacement without needing WooCommerceÌtumọ̀ Yorùbá: ’s built-in fields.
-
What happens if I add new subcategories later?
-
They are automatically included! The plugin checks category relationships at validation time, so new subcategories are picked up immediately.
-
Does this work with AutomateWoo?
-
Yes! When AutomateWoo generates coupons from a template coupon, the category restrictions are automatically copied to the generated coupon.
Àwọn àgbéyẹ̀wò
Kò sí àwọn àgbéyẹ̀wò fún plugin yìí.
Àwọn Olùkópa & Olùgbéejáde
“Category Children Coupons for WooCommerce” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa sí plugin yìí.
Àwọn OlùkópaTúmọ̀ “Category Children Coupons for WooCommerce” sí èdè rẹ.
Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?
Ṣàwárí koodu, ṣàyẹ̀wò ibi ìpamọ́ SVN, tàbí ṣe àgbékalẹ̀ sí àkọsílẹ̀ ìdàgbàsókè nípasẹ̀ RSS.
Àkọsílẹ̀ àwọn àyípadà
1.4.1 Ìtumọ̀ Yorùbá: – 21st January 2026
- Add GitHub Action for wp.org plugin directory release
1.4.0 Ìtumọ̀ Yorùbá: – 18th January 2026
- Added “Product categories (excl. children)” and “Exclude categories (excl. children)” fields Ìtumọ̀ Yorùbá: – match only exact categories without including subcategories.
- Plugin now provides a complete replacement for WooCommerceÌtumọ̀ Yorùbá: ’s built-in category restrictions with both “incl. children” and “excl. children” options.
1.3.0 Ìtumọ̀ Yorùbá: – 16th January 2026
- Plugin renamed from runthings-wc-coupons-category-children to runthings-category-children-coupons to comply with WordPress.org trademark guidelines.
- Automatic migration of existing coupon settings to new meta key format on update.
- Changed filter hook from runthings_wc_coupons_category_children_error_message to runthings_category_children_coupons_error_message.
1.2.0 Ìtumọ̀ Yorùbá: – 15th January 2026
- Added warning notice when conflicting WooCommerce category fields are set alongside plugin restrictions.
- Fixed custom error messages not displaying for percentage and fixed product discount coupons.
1.1.0 Ìtumọ̀ Yorùbá: – 12th January 2026
- Add compatibility with AutomateWoo coupon generation to clone custom meta fields
1.0.2 Ìtumọ̀ Yorùbá: – 6th January 2026
- Fixed missing “And” separator in the coupon usage restriction panel to match WooCommerce core styling.
1.0.1 Ìtumọ̀ Yorùbá: – 4th January 2026
- Fixed fatal error when validating coupons in order context (WC_Order_Item_Product vs array type).
1.0.0 Ìtumọ̀ Yorùbá: – 19th December 2025
- Initial release.
- Allowed categories with automatic child inclusion.
- Excluded categories with automatic child inclusion.
- Filter
runthings_category_children_coupons_error_messagefor custom error messages.
