Support Log in

Choosing Where Fields Appear (Location Rules)

User Guide
Prefer video? Watch the Field Forge tutorials 8 short guides covering every feature Watch

Location rules are the instructions that tell Field Forge which posts, pages, or admin screens should display a particular field group. A new field group starts with one location rule, Post Type is equal to Posts, and the field group editor has no button to remove the last remaining rule. Getting location rules right is essential — they are the bridge between “I built these fields” and “editors can actually use them.”

This section covers everything from the simplest single-condition rule to complex multi-condition setups, with real-world scenarios for each pattern.

How Location Rules Work

Every location rule is a condition made up of three parts:

  1. Parameter — What you are testing. The first list of the rule editor offers Post Type, Post Template, Post Category, Post Taxonomy, Page, Page Type, User Role, Options Page and Block.
  2. Operator — How you are comparing. Usually “is equal to” or “is not equal to.”
  3. Value — The specific value to match. For Post Type it is a list of the public post types of your site, each shown by its name (for example Posts and Pages). For Post Template it is a list that starts with Default Template and goes on with the page templates of your theme, by name. For Post Category it is a list of your categories by name, and for Post Taxonomy it is a list of terms grouped by taxonomy.

When a content manager opens a post in the editor, Field Forge evaluates all field groups and checks their location rules against the current post. If a field group’s rules match, its metabox appears. If they do not match, it stays hidden.

Simple Rules — One Condition

The most common setup is a single condition. Here are the patterns you will use most often:

What You WantParameterOperatorValue
Show on all PagesPost Typeis equal toPages
Show on all Blog PostsPost Typeis equal toPosts
Show on all ProductsPost Typeis equal toProduct
Show only on the homepagePage Typeis equal toFront Page
Show only on one specific pagePageis equal toAbout Us (the list shows each page with its ID)

To set a simple rule:

  1. Open your field group and scroll down to the Location Rules section
  2. Click the first dropdown and select your parameter (e.g., “Post Type”)
  3. The operator defaults to “is equal to” — leave it unless you need “is not equal to”
  4. Select the value from the third dropdown (e.g., “Pages”). For Post Template there is a list of the templates of your theme instead: pick one
  5. Click Publish Field Group (Update Field Group for a group that is already saved)

Combining Conditions with AND (All Must Be True)

When you need multiple conditions to be true at the same time, add them within the same rule group. All conditions in a single group use AND logic — every condition must match for the fields to appear.

Scenario: You want a “Landing Page Hero” field group to appear only on Pages that use the “Landing Page” template. Regular pages with the Default template should not show these fields.
  1. Open the field group, scroll to Location Rules
  2. Set the first condition: Post Type is equal to Pages
  3. Click the + Add rule button (this adds another condition to the same group)
  4. Set the second condition: Post Template is equal to, then pick your Landing Page template from the list of the page templates of your theme
  5. Save

Now both conditions must be true. A post that is a Page but uses the Default template will not see the fields. A Blog Post using any template will not see them either.

Creating Alternatives with OR (Any Group Can Match)

When you want fields to appear in multiple different situations, create separate rule groups. Each group is an independent alternative — if any group’s conditions are satisfied, the fields appear.

Scenario: You want a “Sidebar Content” field group to appear on all Blog Posts, and also on all Pages that use the Full Width template.
  1. Open the field group, scroll to Location Rules
  2. In the first group: Post Type is equal to Posts
  3. Click + Add rule group (this creates a new OR group below)
  4. In the second group: Post Type is equal to Pages, then + Add rule: Post Template is equal to, with your Full Width template picked from the list of the page templates of your theme
  5. Save

The result: fields appear on all Posts (Group 1 matches), OR on Pages with the Full Width template (Group 2 matches). A Page with the Default template would not match.

Step-by-Step: Setting Up a Complex Real-World Rule

Scenario: Imagine you manage a university website. You want a “Course Details” field group to appear on:
  • All “Course” post types (always)
  • “Page” post types, but only when the template is “Department Page”
  • But never for users with the “Subscriber” role (they should not edit course details)

Here is how to build it:

  1. Open your “Course Details” field group
  2. In the first rule group, set: Post Type is equal to Course
  3. Click + Add rule group to create an OR alternative
  4. In the second group, set: Post Type is equal to Pages
  5. Within the same second group, click + Add rule and set: Post Template is equal to and pick your Department Page template from the list of the page templates of your theme
  6. To keep Subscribers out, add a User Role rule to each group. Rules in one group are combined with AND, so a group matches only when all its rules match
  7. In the first group, click + Add rule and set: User Role is not equal to Subscriber
  8. In the second group, click + Add rule and set: User Role is not equal to Subscriber
  9. Click Publish Field Group (Update Field Group for a group that is already saved)

Now the fields appear on Course posts for non-Subscribers, and on Department Page templates for non-Subscribers.

All Available Location Conditions

The first list of the rule editor offers these nine conditions. Post status, post format and parent page are not in that list, so you cannot add them from the editor.

ConditionExamplesWhen to Use It
Post TypePosts, Pages, Products, Events, Team MembersMost common: target a specific content type
Post Templateone of the page templates of your theme, picked from a list by name (Default Template is for a page that uses no template)When only certain templates need the fields
Post Categoryone of your categories, shown by name (categories with the same name under different parents are listed as Parent › Name)When the fields belong to posts in one category
Post Taxonomyone term of a taxonomy such as Tags or a custom taxonomy, listed under the name of its taxonomyWhen the fields belong to posts that have one tag or custom term
PageAll Pages, or one page from the list (shown with its ID)When exactly one page needs the fields
Page TypeFront Page, Posts Page, Top Level, Parent, ChildFor structural page positions in the hierarchy
User RoleAdministrator, Editor, Author, Contributor, SubscriberShow fields only to certain user roles
Options PageSite Settings, Theme Options (PRO)For targeting options page screens
BlockHero, Call to Action, Testimonial (PRO)Bind the fields to a registered Gutenberg block so editors fill them in right inside the block

A Post Category or Post Taxonomy rule matches a post that has the chosen term; with is not equal to it matches a post that does not have it. If the term does not exist, the rule matches no post, with either operator. On the new-post screen, a field group with such a rule is shown only if the new post fits the rule. A new post has no terms yet, except that a new post of the Posts type counts as being in the default category.

Negation Rules — Excluding Content

Sometimes it is easier to say “show everywhere except…” than to list every place the fields should appear. Use the “is not equal to” operator for exclusions.

Examples:
  • Show on all post types except Pages: Post Type is not equal to Pages
  • Show on all pages except the homepage: Page is not equal to Home
  • Show for all users except Subscribers: User Role is not equal to Subscriber

Common Location Rule Patterns at a Glance

ScenarioSetup
All products in the shopPost Type = Product
Only the homepagePage Type = Front Page
Posts and PagesPost Type = Posts (Group 1) OR Post Type = Pages (Group 2)
Everything except pagesPost Type is not equal to Pages
One specific landing pagePage = “Summer Sale 2026”
Pages using two different templatesPost Template = page-landing.php (Group 1) OR Post Template = page-full-width.php (Group 2)
Posts that an Editor role can seePost Type = Posts AND User Role = Editor

> Tip: If your fields are not appearing on a post, check the location rules first. Open the field group, scroll to Location Rules, and verify that the conditions match the post you are editing. This solves the problem 90% of the time.

> Common mistake: Confusing AND and OR logic. Adding a second condition inside the same group means AND (both must match). Adding a new rule group means OR (either can match). If your fields appear on too many posts, you probably used OR when you meant AND. If they appear on too few posts, you probably used AND when you meant OR.

—

Forge AI Assistant Online

Hi! I'm the Field Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs