Location rules decide where a field group shows up. A rule reads like a sentence: Show this field group if Post Type is equal to Book. A new group starts with Post Type is equal to Post, so remember to change it.
- Click and to add a rule that must also match (Post Type is Book and Post Taxonomy is Fiction).
- Click Add rule group to add an or alternative (on Books or on the page "About").
- Each rule can use is equal to or is not equal to.
Popular rules:
| You want the fields on… | Rule |
|---|---|
| A post type | Post Type is equal to Book |
| Every post type except one | Post Type is not equal to Page |
| One specific page | Page is equal to About |
| Pages using a template | Page Template is equal to Landing |
| The home page | Page Type is equal to Front Page |
| Posts in a category | Post Category is equal to News |
| Posts with a term of your own taxonomy | Post Taxonomy is equal to Fiction (a Genre term) |
| Category, tag or Genre edit screens | Taxonomy is equal to Genre |
| User profiles | User Form is equal to Add / Edit |
| Only for some users | Current User Role is equal to Editor |
| Media items | Attachment is equal to All |
| Comments | Comment is equal to All |
| Menus or menu items | Menu / Menu Item |
| Classic widgets | Widget is equal to All |
| An options page | Options Page is equal to Store Settings |
| A custom block built by your developer | Block is equal to your block |
If a group has no rules at all, the builder says "No location rules. This field group will not appear anywhere until you add a rule."
Rules that depend on the page template, the categories or terms, the post format, the parent page or the post status are checked when the edit screen loads. If you change one of those in the editor, save and reload to see the matching field groups.
