Skip to content

WordPress global styles: common gotchas

Global styles in WordPress block themes look like the one-stop control panel for site-wide design — until you discover the precedence rules. The gotchas every team trips over and how to avoid them.

Global styles in WordPress block themes are the configuration panel that promises to control site-wide typography, colors, spacing, and layout from one place. In practice, the global styles surface is overlapping with theme.json, with the Site Editor’s per-template overrides, with block-level overrides on individual blocks, and with the legacy Customizer (still active on hybrid themes). The result is that an editor changes a color in global styles and it does not apply to half the site, and nobody can tell why. The gotchas below are the recurring ones, and how to avoid them when running WordPress operations at scale.

What’s happening

The cascade of styles in a WordPress block theme, in order of precedence (later wins):

  1. theme.json in the theme files — the design system defaults.
  2. The theme’s stylesheets (style.css, enqueued CSS files) — additional rules.
  3. User-modified theme.json settings via the Site Editor’s Global Styles panel — these save to a wp_global_styles custom post in the database.
  4. Per-template style overrides in the Site Editor — saved to wp_template posts.
  5. Per-block style overrides on individual blocks — saved in the block’s attributes inside post_content.
  6. Custom CSS additions via the Site Editor’s “Additional CSS” or Customizer (in hybrid setups).

When an editor changes a primary color in global styles and the change appears on most pages but not others, the answer is almost always #4 or #5 — a template or block was given a more specific override at some earlier point, and the global change cannot reach it without resetting the override.

How to verify

Inspect the current state of global styles:

# the user-modified global styles (database)
wp post list --post_type=wp_global_styles --fields=ID,post_name,post_status
wp post get $(wp post list --post_type=wp_global_styles --field=ID | head -1) --field=post_content | jq .

# the theme's theme.json baseline
cat wp-content/themes/$(wp theme list --status=active --field=name)/theme.json | jq '.styles'

# per-template overrides
wp post list --post_type=wp_template --fields=ID,post_name | head
wp post get <template_ID> --field=post_content | head -20

To find blocks with hardcoded color or typography attributes that will not budge when you change global styles:

# search posts for inline color attributes
wp db query "SELECT ID, post_title FROM wp_posts WHERE post_content LIKE '%style=\"color%' OR post_content LIKE '%backgroundColor%' OR post_content LIKE '%textColor%' LIMIT 20;"

Each match is a block whose color was hand-set in the block editor, which means the global style change will not affect it.

The fix

The gotchas, and the resolution for each:

  1. “I changed the primary color in global styles and it did not update my buttons.” Cause: the buttons were given a custom color directly via the block toolbar. Resolution: open the affected pages, click the button block, in the block sidebar look for “Clear style” or the small “Reset” option next to color. Better long-term: lock down the per-block color picker via theme.json’s appearanceTools settings or by disabling custom colors entirely.

  2. “My typography choice does not apply on archive pages.” Cause: the archive template has a per-template typography override saved to it. Resolution: open the Site Editor → Templates → Archive → click the wrench icon → reset the typography. Alternatively, set the typography at the global styles level and ensure the template is not overriding.

  3. “The Site Editor lets editors change anything, but I want only colors and typography configurable.” Resolution: in theme.json, set settings.appearanceTools to false and individually enable only the controls you want exposed:

    {
      "settings": {
        "color": { "custom": true, "customGradient": false },
        "typography": { "fontSizes": [...], "fontStyle": false },
        "spacing": { "padding": false }
      }
    }
  4. “Global styles changes are not propagating to my child sites in multisite.” Global styles are per-site — each site in a multisite network has its own wp_global_styles post. Resolution: package the global styles as a theme update. The theme’s theme.json is the network-wide default; user-edited global styles override it per site.

  5. “After a theme update, my global styles customizations reverted.” Cause: the theme update changed the structure of theme.json in a way that invalidated some user overrides. Resolution: open Site Editor → Global Styles → Style Variations → re-apply your saved style or re-do the customizations. To prevent this, version-control your global styles export as part of theme releases.

  6. “Spacing presets in theme.json are not appearing in the editor.” The block must be one that supports spacing controls, AND appearanceTools must be enabled or specific spacing settings turned on. Check settings.spacing.padding and settings.spacing.margin in your theme.json. The managed WordPress review checklist surfaces this every time.

For WordPress block-theme sites where global styles changes have become unpredictable, Stack Harbor includes a global-styles inventory and lockdown configuration as part of managed WordPress operations. Book a WordPress consult if your editorial team is making changes in global styles and not seeing them appear consistently across the site.