Documentation

Smart Categories for WooCommerce

Everything about rule-based product categories: how matching works, the complete field and operator reference, nested logic, storefront options, the block and shortcode, performance on large catalogs, and the Pro subcategory generator.

Getting started

Install, then build your first self-maintaining category in about a minute.

  1. Install the plugin. In WordPress go to Plugins → Add New, search for “Smart Categories for WooCommerce”, install and activate. WooCommerce 7.0+ and PHP 7.4+ are required.
  2. Open Smart Categories. A new top-level menu appears in the admin sidebar. On a fresh install you land on a welcome screen that scans your catalog and suggests ready-made collections with live product counts.
  3. Create your first category. Click Create on a suggestion, or Build a custom category to write your own rules. The live preview shows exactly which products match while you compose.
  4. Press “Create and populate”. The category is created and matching products are assigned right away. You land on a result screen showing how many products were added, with a link to view the category on your store.
Nothing to configure. There are no global settings to set up first — every rule set lives on its own category.

How matching works

A smart category is an ordinary WooCommerce product category with a rule set attached. The plugin evaluates your rules and writes the result into normal category relationships, which is why the storefront stays fast: shoppers read plain WordPress data, exactly as if you had assigned every product by hand.

When rules run

  • On product save — and whenever a price or stock level changes.
  • Daily sweep — catches indirect changes, such as a sale schedule that starts at midnight or a product that has simply aged out of “New arrivals”.
  • On demand — the refresh button on every category card re-scans the whole catalog immediately. Useful right after a bulk import.

What the plugin will never touch

The plugin keeps a ledger of the memberships it created and only ever removes those. Products you assigned by hand — before or after adding rules — are treated as yours and left alone. Deleting the plugin removes its own data only; your categories and product assignments stay exactly as they are.

Only published products are evaluated. Drafts and private products are ignored until they are published.

Rule reference

Every rule is a field, an operator and a value. More than 35 fields are available; attribute fields appear automatically for every global attribute your store defines.

Product basics

FieldOperatorsNotes
Title, SKU, Description, Short descriptioncontains, does not contain, is, is not, starts with, ends with, matches regexText matching is case-insensitive.
Product typeis, is notSimple, variable, grouped, external.
Featuredis true / is falseThe WooCommerce “featured” flag.
Has imageis true / is falseHandy for catalog maintenance collections.

Price & promotions

FieldOperatorsNotes
Price, Regular price, Sale price=, ≠, >, ≥, <, ≤, betweenUses the store's active price.
On saleis true / is falseRespects scheduled sale dates.
Discount %=, ≠, >, ≥, <, ≤, betweenComputed from regular vs sale price — ideal for an “Outlet” collection (e.g. discount ≥ 40).

Stock

FieldOperatorsNotes
Stock statusis, is notIn stock, out of stock, on backorder.
Stock quantity=, ≠, >, ≥, <, ≤, betweenOnly meaningful when stock management is enabled.

Taxonomy & attributes

FieldOperatorsNotes
Product categoryis in, is not in, is in or under“in or under” includes child categories.
Product tagis in, is not in
Brandis in, is not inAppears when a brand taxonomy exists (WooCommerce Brands or a compatible plugin).
Shipping classis in, is not in
Any global attribute (Colour, Size, Material…)is in, is not inOne field per attribute, listed automatically.

Ratings, dates & measurements

FieldOperatorsNotes
Average rating, Review countnumeric operators
Total sales (all time)numeric operatorsWooCommerce's lifetime sales counter.
Date created, Date modifiedin the last N days, before, after“In the last 30 days” powers New Arrivals.
Weight, Length, Width, Heightnumeric operators
Custom field (meta)text and numeric operatorsMatch any meta key your store or another plugin writes.
Pro adds time-window sales fields: units sold in the last 7 / 30 / 90 days, 30-day revenue, sales velocity (units per day) and days since the last sale. See Pro features.

Nested AND / OR / NOT

Rules live inside groups. A group either requires ALL of its conditions (AND) or ANY of them (OR), and any group can be negated with NOT or nested inside another group — with no depth limit.

Think of a group as parentheses in maths: everything inside is evaluated as one block.

Example — discounted shoes from two brands, excluding clearance:

ALL of:
  Category is in        [ Shoes ]
  On sale               is true
  ANY of:
      Brand is in       [ Nike ]
      Brand is in       [ Adidas ]
  NOT ( Tag is in       [ Clearance ] )

Without the inner group, “OR” would apply to the whole rule set and the category would fill up with every Nike product in the store. The plugin shows a worked example of exactly this while you build.

Check a specific product. On the category edit screen you can type a product name under the preview and the plugin explains, condition by condition, why that product matches or fails.

Templates

Ten ready-made rule sets get you started; every one is fully editable before you create it.

TemplateRule
New ArrivalsCreated in the last 30 days
Best SellersTotal sales ≥ 10
On SaleOn sale is true
Big Discount (Outlet)Discount ≥ 40%
Back in StockStock status is “in stock” and recently modified
Low StockStock quantity ≤ 5 and in stock
FeaturedFeatured is true
Premium (High Price)Price ≥ a threshold you set
Sold OutStock status is “out of stock”
Missing ImageHas image is false (catalog maintenance)

Existing categories & tags

You do not have to create a new category. Edit any product category (Products → Categories) and you will find the Smart Category Rules panel on its edit screen. Add rules, save, and matching products join the products already there — your manual assignments stay untouched.

The same works for product tags: point a rule set at a tag to build automatic tag-based collections.

Storefront sorting & stock

Each smart category can control how its shop page is ordered, independently of the store default:

  • Product order — default (leave to the theme), best-selling, newest, price (low→high or high→low), or rating.
  • Out-of-stock products — leave as is, push to the end of the list, or hide them entirely.
These settings only affect the display order on the category's shop page — never which products belong to the category.

Block & shortcode

Show a smart category's products anywhere — a landing page, a campaign post, the homepage.

Block

In the editor, add the Smart Category Products block, then pick the category, the number of products and the order.

Shortcode

[scwc_products id="12" limit="12" columns="4" orderby="date"]
AttributeDefaultValues
idCategory ID (required). Find it in the URL when editing the category.
limit12Maximum products to show.
columns41–6.
orderbydatedate, price, popularity, rating, title, menu_order

Products hidden from the catalog are skipped automatically, so the grid always shows as many products as you asked for. Because membership is written to real categories, native WooCommerce blocks such as “Products by Category” work with smart categories too.

Performance

The storefront is untouched. No rule evaluation happens on your product or category pages — shoppers read plain category relationships.

Creating a category populates immediately on small and medium catalogs. Very large catalogs are processed in queued background batches (Action Scheduler) so nothing times out; the result screen tells you when population continues in the background, and counts update as the jobs finish.

On a very quiet site background jobs run on the next admin or front-end visit — that is WordPress's cron behaviour, not a plugin limitation. The refresh button always runs immediately.

Pro features PRO

The complete rule engine above is free, without limits. Pro adds scale and automation.

Automatic subcategory generator

Pick one attribute — or two — and Pro generates one smart subcategory per value or per combination. “Dresses” × Colour × Size becomes Red XL Dress, Blue M Dress, and so on: each a real, indexable category page with composed rules (in the parent and has that value), kept in sync automatically.

  • Name templates — compose names from {value1}, {value2}, {parent} and free text.
  • Live preview — see every subcategory that would be created, with its product count, before generating.
  • Categories or tags — generate child categories or global tags.
  • Daily growth — when a new attribute value appears (a new colour arrives), its subcategory is created on its own.
  • Pre-build a season — optionally create empty combinations too; they fill themselves as matching products arrive.

Category Tree

A live map of every smart term: parents with their generated subcategories as a collapsible tree, product counts, “auto” badges and daily-sync indicators, with edit and storefront links on every row.

Sales-intelligence rules

A daily background aggregation reads your completed orders and computes per-product windows, which then become rule fields:

  • Units sold in the last 7 / 30 / 90 days
  • Revenue (30 days) and sales velocity (units per day)
  • Days since the last sale — the basis for stale-stock cleanup collections

Two extra templates ship with them: Trending (30 days) and Stale Products. Collections built on these fields refresh themselves every day.

What happens if a Pro licence expires?

Nothing breaks. Every category and subcategory you generated keeps working and stays in sync through the free engine. You lose automatic growth of new attribute values, the sales-intelligence fields, updates and priority support — reactivating restores them.

See Pro pricing

For developers

Filters for tuning behaviour in a child theme or a small plugin:

FilterDefaultWhat it does
scwc_sync_threshold5000Published-product count above which population is queued in the background instead of run synchronously.
scwc_evaluated_post_statuses['publish']Which post statuses the engine evaluates.
scwc_pcre_backtrack_limit100000PCRE backtrack limit for the “matches regex” operator (ReDoS guard).
scwc_review_min_days / scwc_review_min_products7 / 20When the review request may appear.
scwc_hierarchy_max_children PRO200Hard cap on generated subcategories per parent.
scwc_hierarchy_min_products PRO1Minimum matching products before a subcategory is generated.

WP-CLI

wp scwc list                 # every smart category with its counts
wp scwc run <term_id>        # re-evaluate one category now
wp scwc run-all              # re-evaluate every smart category

The REST namespace is scwc/v1; all routes require the manage_woocommerce capability.

Troubleshooting

A product is not matching my rules

  • The group requires ALL conditions while you meant ANY — the most common cause.
  • The product is not published; only published products are evaluated.
  • The value differs subtly — for example an attribute value versus a tag with the same name.

Open the category's edit screen and use the product check under the preview: it explains condition by condition why that product matches or fails.

The count looks stale or the category looks empty

Click the refresh button on the category card — especially after a bulk import. Then verify the rules with the live preview: an ALL group with contradictory conditions (for example “on sale is true” and “on sale is false”) matches nothing by design.

My subcategories did not grow after adding a new colour PRO

New attribute values are picked up by the daily sync. To apply them immediately, open the parent category and press Sync now. Check that Auto-add new values is still enabled, and that the combination actually has matching products (empty ones are skipped unless you ticked “Also create empty combinations”).

Deactivating or deleting the plugin

Deactivating pauses all automation — nothing is added or removed. Deleting removes the plugin's own data (rules, settings, its membership ledger) but never your categories or product assignments: each category simply becomes an ordinary WooCommerce category with its current products.

Still stuck?

Free users: the community forum on wordpress.org — please include your WordPress and WooCommerce versions and the rule set that misbehaves. Pro customers have priority support through the Contact Us entry in the plugin menu.