Elementor display conditions
5 min read
WPM Conditions hides an Elementor element on the live page unless the current post's field values match rules you set. Use it to show a "Sale" badge only when a True / false field is on, a price box only when a price exists, or one of two sections depending on a Select.
Part | Plan |
|---|---|
Evaluating saved rules and hiding elements | Free (needs Elementor 3.5+, free is enough) |
Editing the rules in the editor | Pro |
Add conditions
- Select a widget, section, column or container in Elementor.
- Open the Advanced tab and the WPM Conditions section.
- Switch Show by field values on. The help text reads: "The editor always shows the element; check the result on the live page."
- Under Show when, choose All rules match (default) or Any rule matches.
- Under Rules, add one rule per row: choose a Field, a Condition and, where needed, a Value.
- Update the page and check it on the live site.
The controls
Control | Meaning |
|---|---|
Show by field values | Turns the conditions of this element on or off. Off means the element is always shown, even if rules are saved. |
Show when | All rules match (every rule must pass) or Any rule matches (one is enough). |
Rules | The list of rules. Each shows its chosen field as its title. |
Field | Any active field, listed as "Group › Field" (all field types with a value, except Password). |
Condition | One of the operators below. |
Value | The value to compare with. Not shown for Has a value and Is empty. |
Conditions (operators)
Condition | Passes when |
|---|---|
Has a value | the field has a value (see below) |
Is empty | the field has no value |
Is equal to | the value equals one of the field's values |
Is not equal to | the value equals none of them |
Contains | one of the field's values contains the text |
Does not contain | none of them contains the text |
Is greater than | the field's first value, as a number, is greater than the number you typed (and the field has a value) |
Is less than | the first value, as a number, is less than the number you typed (and the field has a value) |
How rules are evaluated
- The field is read from the current post of the page being shown. In a loop, from the loop item.
- The comparison uses the stored value, not the printed one: for a Select type the stored value (
red), not its label ("Red"). For a True / false field, "on" is the text1and "off" is empty. Numbers compare as text for equality and as numbers for greater or less than. - A field that holds a list (Checkboxes) counts as several values: Is equal to passes if any item equals your text; Is not equal to passes only if none does.
- Whitespace around values is ignored. The number
0counts as a value; an empty text, an empty list and an "off" True / false do not. - With All rules match, every rule must pass. With Any rule matches, one is enough. No rules at all means the element is shown.
- At most 20 rules per element are used.
- A rule on a field that does not exist (for example a deleted one) counts as "no value", so Has a value fails and Is empty passes. A rule whose condition is unknown passes.
- The element is hidden only on the front end. The Elementor editor and its preview always show it.
- Elements with conditions are kept out of Elementor's element cache, so every post gets its own result.
Repeater, Flexible content, Group and Clone fields
A Repeater or Flexible content field counts as having a value when it has at least one row with something filled in: Has a value passes and Is empty fails. Rows whose sub-fields are all empty do not count, and a field with no rows is empty. The rules cannot look inside a row (compare a sub-field's value); they only tell whether rows exist. Group and Clone fields (stored as objects) have a value when any sub-value is filled in.
Without a license, or without the Pro code
Situation | What happens |
|---|---|
Pro license active (or a trial) | Full controls. |
License expired, or a plan without page builder widgets | Saved conditions keep hiding elements. In the WPM Conditions section you see "Renew your license to edit conditions. Saved conditions keep working, and you can turn them off here." and only the Show by field values switch, so you can turn the conditions of an element off. The rules cannot be edited. |
Free plugin (no Pro code) | The WPM Conditions section does not exist. Conditions saved earlier (or imported with a page) are still evaluated, so a page does not change when Pro is removed. |
See License expiry.
Troubleshooting
- The element is still visible on the live page. Check that Show by field values is on, that the page you view is not served from a page cache older than your change (see Page cache plugins), and that the rule compares the stored value (
red), not the label. - The element disappeared on the live page but shows in the editor. The editor always shows elements; the rules failed on the live page. Check the field value on that post.
- "Has a value" fails for my repeater. The field has no row with a filled sub-field; rows that are entirely empty do not count.
- I cannot edit rules. The license has expired or does not include page builder widgets. Turn the switch off to show the element always.
Still stuck? Contact support