Before You Start
You need Listeo theme, Listeo Core, Listeo Forms & Fields Editor and Listeo Elementor 2.3 or newer. Update them together. Nothing changes on your site until you add a rule. Fields without rules are saved and shown exactly as before.
What Field Visibility Rules Do
One listing type often covers different kinds of items. A classifieds site may sell cars, motorcycles and phones under the same Classifieds type. Without rules, every owner sees every field, so a phone seller is asked for the number of doors. A rule has two parts. You can use one or both:
- Where this field applies (scope): the field exists only for listings in the categories you check. Example: Doors only for Cars.
- Show this field when (conditions): the field is shown or hidden depending on the value of another field or taxonomy. Example: Battery capacity only when Fuel is Electric.
When both are set, the field must be in one of the checked categories and its conditions must match. When to use it
- Multi-category directories and classifieds (cars, real estate, jobs, equipment) where fields differ by category.
- Follow-up questions: show “Mileage” only for used items, “Pet fee” only when “Pets allowed” is checked.
- Shorter forms: owners see only the fields that apply to their listing.
Where to Find It
- Go to WP Admin → Listeo Editor → Listing Fields.
- Open the tab of the listing type you want to edit, for example Classifieds Fields.
- Click a field. Its settings open in a side panel with the tabs General, Display, Form input and Rules.
- Open the Rules tab. It has two sections: Show this field when and Where this field applies.
After you change a rule, click Save Changes in the save bar. Changes in the side panel are kept until you save. Fields with rules show a short summary in the list, for example “Shown on Cars listings only.” or “Hidden when Fuel is Petrol.” Use the With rules filter above the list to see only those fields.
Step 1: Limit a Field to Some Categories
Example: Doors should only be asked for cars.
- Open the Doors field and go to the Rules tab.
- Under Where this field applies, check Cars.
- Click Save Changes.
Good to know:
- Leave the list empty to show the field for every category.
- Subcategories count. If you check Vehicles, the field also applies to Vehicles → Cars and Vehicles → Vans.
- Translations count (WPML). A translated category matches its original.
- On a listing type tab you see the main Categories list and, if the type has its own category taxonomy, that list too. When you check terms in both lists, the listing must match both.
- Each list has a Filter box. With more than 150 categories, the list turns into a search: type at least 2 letters to find a category. Selected categories are shown as chips you can remove.
Step 2: Show or Hide a Field Based on Another Field
Example: Battery capacity should appear only for electric cars.
- Open the Battery capacity field and go to the Rules tab.
- Under Show this field when, keep the Action on Show this field when. Choose Hide this field when if it is easier to describe when the field should go away.
- Click + AND rule to add the first rule.
- Pick the field (or taxonomy) the rule reads, for example Fuel.
- Pick an operator, for example has any of, and the value Electric.
- Click Save Changes.
Leave the section empty to always show the field.
AND rules and OR groups
- + AND rule adds a rule to the same group. All rules in a group must match.
- + OR group adds a new group. One matching group is enough.
Example: show Mileage when Condition is Used, OR when Condition is Demo AND Year is less than 2025. That is two groups: the first has one rule, the second has two.
Operators
The operators you can pick depend on the type of the field the rule reads:
| Field the rule reads | Operators |
|---|---|
| Text, Textarea | is, is not, contains, greater than, at least, less than, at most, is empty, is not empty |
| Select (one choice) | is, is not, is any of, is none of, is empty, is not empty |
| Multi Select, Multi Checkbox | has any of, has none of, is empty, is not empty |
| Checkbox | is checked, is not checked |
| A taxonomy (categories, features, regions, custom taxonomies) | has any of, has none of, is empty, is not empty |
| Other field types (date, file, repeatable) | is empty, is not empty |
- For “is any of”, “is none of”, “has any of” and “has none of” you can pick several values.
- “greater than”, “at least”, “less than” and “at most” compare numbers. They work when the other field holds a plain number such as
2019or74000. A value written with a thousands separator, such as74,000, is not read as a number and the rule does not match. - A taxonomy with more than 300 terms gets a text box instead of a checklist: type the term slugs, separated with commas.
Which fields a rule can read
- Fields on the same tab.
- On a listing type tab, also the fields of Contact Fields, Locations Fields and Hidden Custom Fields. They are listed in their own groups in the field picker.
- On Contact Fields, Locations Fields or Hidden Custom Fields, only the other two of these tabs. A field of one listing type would be empty for every other type.
- Any listing taxonomy, listed under Taxonomies: categories, features, regions and your custom taxonomies .
Rules can depend on each other. If Battery capacity is hidden, a field whose rule reads Battery capacity sees it as empty.
Example: a Car Classifieds Setup
| Field | Where this field applies | Show this field when |
|---|---|---|
| Doors | Cars | (empty) |
| Engine capacity | Cars, Motorcycles | Fuel has none of Electric |
| Battery capacity | Cars | Fuel has any of Electric, Hybrid |
| Mileage | Vehicles (with all subcategories) | Condition is Used |
| Warranty until | (empty) | Condition is New |
In this example Fuel is a custom taxonomy and Condition is a Select field.
Where the Rules Apply
| Place | What happens |
|---|---|
| Add Listing form (front end) and the Listeo listing editor in wp-admin (Listings → Edit) | Fields appear and disappear live while the owner fills the form, also in multi-step forms. A hidden field is never required, so it never blocks the form. The server checks the rules again on save. |
| Listing page and preview | Hidden fields are left out of the details. Old values of fields outside their categories are not shown. |
| Listing cards | Fields set to show on cards follow the same rules. |
| Elementor | The Listing Custom Fields widget, the Listing Custom Field widget and the Listeo Custom Fieldsdynamic tag show nothing for a field hidden on that listing. |
| Search forms | A filter for the field follows the same rules. See the next section. |
Search Filters Follow the Rules
When a Listing Field with rules is used as a search filter, the filter follows the field’s rules:
- A filter limited to some categories appears only after the visitor picks one of those categories, or automatically on that category’s archive page. With no category chosen, it stays hidden.
- A Show this field when rule works inside the search form. Example: the Battery capacity filter appears after the visitor picks Electric in the Fuel filter. The filter the rule reads must be in the same search form.
- A hidden filter is not sent with the search and is not stored in saved searches.
You can turn this off for one filter:
- Go to WP Admin → Listeo Editor → Search Forms and open the form.
- Click the element to open its side panel.
- In the Visibility section, uncheck Follow the field’s rules. It is checked by default.
- Click Save Changes.
What Happens to Hidden Values
What changed for existing sites
Nothing changes until you add rules. Once you do, values are handled differently depending on why a field is hidden:
| Hidden by | On save |
|---|---|
| Where this field applies(category) | The field is skipped. Its stored value is kept, but not shown. If the listing moves back to a matching category, the value is visible again. |
| Show this field when / Hide this field when | The stored value is removed when the listing is saved from the Add Listing form or the Listeo listing editor. For a custom taxonomy, its terms are removed from the listing. |
Example: a car is first listed as Used with a mileage of 40,000 km. The owner changes Condition to New and saves. Mileage is hidden by its rule, so the 40,000 km value is deleted. Switching back to Used shows an empty Mileage field.
Limitations
- The classifieds price in the listing sidebar and on cards always shows. It ignores rules.
- The WordPress editor screen (the WordPress editor row action in Listings) shows every field and does not apply rules. Saving there never clears values.
- Polylang: translated categories are not matched to their originals. WPML is supported.
- Roles and packages: rules cannot depend on the user role or the listing package yet.
- Not covered: structured data (JSON-LD), the AI search index, the social links block, Listeo Booking Plus resource cards, imports and converters, and the MCP connector’s meta writes. These read or write fields without the rules.
- Search results: rules hide filters, they do not filter listings.
FAQ and Troubleshooting
-
I added a rule, but the field still shows in the Add Listing form
-
The field shows on the listing page but not in the form
-
A search filter never appears
-
Values disappeared from my listings
-
Can a rule read a field from another listing type?
-
Do rules travel with Export & Import?
Related Articles
- Custom Taxonomies : create taxonomies such as Fuel or Body type, and use them in rules.
- Related Taxonomies and Chained Select : Make → Model.
- Adaptive Search Filters and Result Counts .
- Search Form Elements Reference .
- Conditional fields and displaying them on listing page: category-specific fields and headlines.
For Developers
Rules are stored on the field definition in the Listing Fields options (keys scope and conditions). The evaluator is Listeo_Core_Field_Rules in Listeo Core.
PHP filters and actions
listeo_core_field_rules_hidden($hidden,$rules_by_key,$selected_terms,$context): the fields hidden by rules, asmeta_key => 'scope'|'conditions'. Add or remove keys to change the result.listeo_core_field_rules_cleared(action,$listing_id,$keys): fired after the values of condition-hidden fields were removed on save.listeo_core_submit_fields($fields,$listing_type,$listing_id): the submit form fields, after Listeo Core built them.listeo_core_search_filter_rules($rules,$element,$key): the rules of one search filter.listeo_core_search_rules_library_map($map,$definitions): the field rules search filters inherit, by key.listeo_fafe_field_rules_config($config,$context): the operators and labels of the rules UI in Listeo Editor.
Helpers
listeo_core_is_field_hidden_for_listing( $key, $post_id = 0 ): true when a field is hidden on a listing by its rules. Use it in custom templates that print a single field.listeo_core_get_rule_hidden_field_keys( $post_id ): every hidden field of a listing, asmeta_key => 'scope'|'conditions'.
// Print a field only when its rules allow it.
$key = '_battery_capacity';
if ( ! listeo_core_is_field_hidden_for_listing( $key, get_the_ID() ) ) {
echo esc_html( get_post_meta( get_the_ID(), $key, true ) );
}
JavaScript
listeo:field-rules-applied(document event): fired after the Add Listing form applied the rules. The handler receives the hidden keys.listeo:term-fields-loaded(document event): fired after the category fields were loaded by AJAX in the Add Listing form. Trigger it yourself after you inject fields, so the rules run again.- Field wrappers carry
data-field-keyanddata-field-type, search filter wrappers carrydata-filter-key. A hidden field wrapper gets the classlisteo-field-hidden, a hidden search filterlisteo-filter-hidden.
