Native textIndent Block Support in WordPress 7.0: A Pragmatic Guide

WordPress 7.0 just introduced textIndent block support, and if you’ve been building custom themes for any length of time, you know why this matters. Since 2021, we’ve been relying on brittle custom CSS or hacky block styles to achieve standard typographic indentation. Now, it’s finally native, but as with everything in Gutenberg, there’s a specific way to implement it without breaking your layout.

Why Native textIndent Block Support Matters

Typographic conventions are rarely simple. In English publishing, the first paragraph of a section usually isn’t indented, while every subsequent paragraph is. However, in RTL languages like Arabic or Hebrew, it’s common to indent everything. Previously, we’d handle this with a selector like p + p { text-indent: 1.5em; } in our stylesheets.

The new textIndent block support moves this logic directly into the block.json and theme.json ecosystem. It’s cleaner, it respects Global Styles, and it finally gives clients a UI control that doesn’t involve them writing a single line of CSS. This follows the same trajectory as other recent improvements like WordPress 7.0 dimensions support.

Opting In via block.json

If you’re building a custom block and want to provide a “Line Indent” control in the Typography panel, you just need to declare it in your block.json. It’s part of the typography supports object, sitting right alongside letterSpacing and lineHeight.

{
  "supports": {
    "typography": {
      "textIndent": true
    }
  }
}

Once you ship this, the block editor automatically adds the control to the sidebar. The value is serialized as a text-indent CSS property on the block’s wrapper or selector.

The “Subsequent” vs. “All” Selector Logic

This is where it gets technically interesting. The core Paragraph block handles this differently than a generic block. Because of the typographic conventions I mentioned earlier, WordPress uses a typography.textIndent setting to switch between selectors. This is a level of nuance we haven’t seen in many other block supports.

  • Subsequent (Default): Uses the .wp-block-paragraph + .wp-block-paragraph selector. Only paragraphs following another paragraph get the indent.
  • All: Uses the .wp-block-paragraph selector. Every paragraph gets indented.

This implementation is a massive win for performance because it leverages native CSS sibling selectors rather than a JS-based “am I first?” check. For a deeper look at how selectors are evolving, check out how pseudo-selectors are handled in theme.json.

Configuration in theme.json

As a senior dev, I prefer to keep my UI clean. If your design doesn’t need indentation, don’t just leave it enabled. You can control the default behavior and the availability of the control in your theme.json.

{
  "settings": {
    "typography": {
      "textIndent": true
    }
  },
  "styles": {
    "blocks": {
      "core/paragraph": {
        "typography": {
          "textIndent": "2em"
        }
      }
    }
  }
}

If you want to force the “Indent All” mode globally (useful for specific RTL-first themes), change the setting from a boolean to the string "all". Refer to the official block supports documentation for more on these opt-ins.

Look, if this textIndent block support stuff is eating up your dev hours, let me handle it. I’ve been wrestling with WordPress since the 4.x days.

Final Takeaway for Developers

The introduction of textIndent in WordPress 7.0 is another step toward deprecating large, monolithic stylesheets in favor of granular theme.json configurations. It respects internationalization and offers a pragmatic solution to a long-standing typographic request. Stop writing manual p + p CSS and start using the native API—your future self (and your site’s performance) will thank you.

author avatar
Ahmad Wael
I'm a WordPress and WooCommerce developer with 15+ years of experience building custom e-commerce solutions and plugins. I specialize in PHP development, following WordPress coding standards to deliver clean, maintainable code. Currently, I'm exploring AI and e-commerce by building multi-agent systems and SaaS products that integrate technologies like Google Gemini API with WordPress platforms, approaching every project with a commitment to performance, security, and exceptional user experience.

Leave a Comment