Editorial illustration.
A notice that should appear only on product pages can be confusing when it shows up in the blog, or disappears for logged-out visitors. Drupal block visibility is controlled by conditions attached to a block placement. A block can be enabled and placed in a region yet still be hidden because one condition does not match the current request. Check placement and visibility together, then test the page as the intended visitor.
Summary
- Confirm the block is enabled in a region for the active theme.
- Use page, content type, role or language conditions for the intended audience.
- Multiple conditions can narrow visibility; test combinations instead of assuming they are alternatives.
- Verify an aliased path, the front page and logged-out behavior on the rendered page.
Start with the active theme and region
Open Structure > Block layout at /admin/structure/block and make sure you are configuring the theme used on the page being tested. Block placement is theme-specific. A block placed in a region of the administration theme will not automatically appear in the front-end theme.
Find the block and confirm it is enabled and assigned to a region. Some themes do not render every region on every route, and some blocks produce no output when their data is empty. Check those basics before changing visibility rules. Drupal’s Block module guide describes placement and visibility settings.
Pick the condition that matches the requirement
Choose a condition based on what the rule means:
- Pages: show or hide for paths such as /services or /services/*.
- Content types: apply to node pages of selected bundles, such as Article or Product.
- Roles: target authenticated, anonymous or a specific role.
- Languages: restrict the block to a language when the site’s language setup supports it.
A path rule is useful for a landing page or a group of routes, but it is brittle when the URL structure changes. A content-type rule follows the kind of node rather than its alias, which may be a better fit for a repeated notice. A role rule targets the visitor’s access context; use it carefully for content that should not be public.
Drupal’s core change record on block visibility lists core conditions including Content types, Roles, Pages and Language. Available conditions can differ if contributed modules add more options.
Configure one rule at a time
- Open the block’s Configure link from the active theme’s block layout page.
- Expand Visibility and select the relevant condition, such as Pages or Content types.
- Choose whether the block should appear for matching values or be hidden for them. The form’s negate option reverses the condition; read the label carefully.
- Save the block placement and clear the relevant cache if the change is not visible after a normal page refresh.
- Test one matching page and one page that should not match. Repeat as an anonymous visitor and a representative logged-in role.
With multiple conditions, treat each as an additional gate unless the UI explicitly provides an any/all grouping. For example, a block restricted to Article content and the Editor role will be hidden from an anonymous visitor even on an Article page. That may be right for an editorial prompt, but wrong for a public campaign notice.
Test path conditions against the real route
A page alias and an internal path can identify the same content, but path matching has details that are easy to miss. Drupal’s block page UI commonly asks for paths relative to the site root; the front page uses the special <front> token. A wildcard should match only the intended segment. Test the exact path, a nested path and a near-match so that /help/* does not accidentally capture /helpdesk when your intended URLs differ.
If the site uses language prefixes, domains or custom route parameters, test each real URL form. Do not assume that a path condition behaves identically in Layout Builder preview and on the final public route. If the block is placed inside a Layout Builder section, verify the behavior on the actual rendered content page as well.
When visibility appears inconsistent
Check these in order:
- Is the right theme active and the block placed in a region that renders on this page?
- Is the block’s own enabled status on?
- Do all configured conditions match the current path, content type, role and language?
- Does the block have content or data to render for this request?
- Are you seeing cached output? Retest in a private window and clear caches only after confirming the rule is correct.
- Does custom access code or a contributed visibility module add another condition?
Avoid adding a second copy of the block before diagnosing the first. Duplicate blocks can produce different cache behavior and make later edits difficult. If two audiences genuinely need different content, separate placements may be appropriate; name each administrative label clearly so editors know which one they are changing.
For a related Drupal access issue on a route, see our custom route permission troubleshooting guide. If a menu entry rather than a block is missing, use the Drupal menu link checklist.
Mistakes to avoid
Do not use a role condition as a substitute for protecting sensitive data in the underlying route or entity. Visibility determines whether a block is placed in output; it does not grant or remove access to the data elsewhere. Do not test only as an administrator, who may see content hidden from anonymous visitors. And do not clear every cache repeatedly when the condition is simply reversed or assigned to the wrong theme.
My Take
The fastest reliable fix is usually to write down the audience in one sentence: “Show this public notice on every article page in English.” That sentence maps directly to content type and language conditions. If the rule needs a long list of exceptions, the block may belong in a more specific layout or a purpose-built component.
Conclusion
A Drupal block’s visibility depends on both its placement and its conditions. Confirm the active theme and region, apply the narrowest condition that expresses the requirement, then test matching and non-matching routes using the intended roles and languages. That makes a visibility bug much easier to explain and maintain.