Store policy rules are checks you write for your own store, under WooCommerce ÔåÆ Channel Readiness ÔåÆ Store policy. Each rule becomes one row in the product checklist, in the Store policy group, and is enforced by the free plugin’s publish gate exactly like a pack check.
Every rule has:
- a label (1ÔÇô60 characters), shown as the checklist row;
- a type, one of the six below, with its settings;
- a severity: Required keeps a failing product as a draft, Warning only shows it;
- an on/off switch;
- a scope: which products it applies to (see Scope).
A store can have up to 50 rules. Rules are checked in the order they are listed.
The same tab holds the Store policy pack’s two optional title checks; see packs.md.
Rule types
A custom field is filled in (required_meta)
Passes when the product’s custom field (post meta) holds a non-empty value.
| Setting | Meaning |
|---|---|
| Meta key | The key the value is stored under, such as _supplier_code. Letters, digits, _ - : ., up to 64 characters. |
| Input name (optional) | The name of the editor field that posts the value, when it differs from the meta key. Defaults to the meta key. |
Example: label “Supplier code is set”, meta key _supplier_code, severity Required. A product without a supplier code cannot be published.
When another plugin’s field posts under a name you have not entered as the input name, the rule judges the value saved before you clicked Publish. See limits.md.
An attribute has a value (required_attribute)
Passes when the product has the attribute with at least one non-empty value. Works for global attributes (pa_) and for custom attributes typed on the product.
Example: label “Material is listed”, attribute pa_material, severity Warning.
A term is selected (required_term)
Passes when at least one term of the taxonomy is selected: a category, a tag, a brand, or a term of any other taxonomy registered for products (WooCommerce’s internal product type and visibility taxonomies are not offered).
Example: label “Has a brand”, taxonomy product_brand, severity Required.
A rule whose taxonomy is later removed (for example, the plugin that registered it is deactivated) is kept and skipped, never failed.
A minimum number of images (min_images)
Passes when the product has at least this many distinct images, counting the featured image and the gallery (and, on a variable product, the images of its enabled variations). The minimum is 1 to 20.
Example: label “At least three photos”, minimum 3, severity Warning. The message reads “This product has 1 images. It needs 3.”
A minimum description length (min_description)
Passes when the description is at least this many characters. The minimum is 1 to 10,000.
Example: label “Description is detailed”, minimum 300, severity Required.
Forbidden words in the title (forbidden_words)
Passes when the title contains none of the listed words. Up to 100 words, each 1ÔÇô40 characters. Matching ignores case and works on whole words: sale matches “Summer Sale” but not “Wholesale”.
Example: label “No promotional words”, words sale, free shipping, cheapest, severity Required. The message names the words found: “Remove from the title: sale.”
Scope
Every pack and every store policy rule has a scope, which decides the products it applies to.
| Mode | Applies to |
|---|---|
| All products | Every product. |
| Only these products | Products that match the conditions. |
| All except these products | Products that do not match the conditions. |
The conditions are product types (simple, variable, grouped, external), categories, tags and brands. A product matches when, in every dimension you filled in, it has at least one of the values you chose. A category or brand also covers its sub-categories or sub-brands.
Examples:
- Only these, categories “Electronics”: every product in Electronics or one of its sub-categories.
- Only these, types “Variable”, brands “Acme”: variable products of the Acme brand.
- All except these, tags “Handmade”: every product except those tagged Handmade.
“Only these” with no conditions chosen applies to nothing.
A product outside a rule’s scope does not list the rule in its checklist at all.