Content-only block editing

As WordPress blocks—and therefore patterns—continue to expand in scope, the need for a simplified editing experience is more present than ever. Sure, the new tooling is nice — like fluid typography, new spacing controls, element hover color support, padding, layout, etc — but it’s also quite a lot to take in.

Cue the new template locking mechanism for making only content blocks (text and images) editable within a pattern, landing in the upcoming WordPress 6.1 release.

Content-only vs. block locking 

First off, content-only editing is different from standard block locking. Block locking refers to disabling a block from either being moved, or removed entirely. It doesn’t consider the type of block, or editor experience of that block. Content-only editing is a mechanism designed to be used more-so at the pattern level (one atomic level up from a block).

When applied to a block pattern, all content blocks nested within continue to be editable, but moving and removing is disabled, and all design controls are hidden—leading to a much cleaner interface.

One where there’s not tens of options in the block inspector sidebar, and the normal nested block interaction layers are fused into one. Just check out this before and after views, with content editing applied to the pattern’s top-level group block:

It’s astounding really. Much simpler. You click on a heading block to edit its text—regardless of how nested the heading is. And instead of having all the color, typography, dimensions, or any other control, you see a list of editable content blocks. That’s it.

But if you want to switch back to the full-blown editor view—where all block controls are available—you can do so by pressing the “Modify” toolbar control at the top-level block. Press it again and you’ll see the simplified view once again.

How to enable content-only editing

The new mechanism stems from the existing templateLock attribute. Editing a pattern with an "templateLock": "contentOnly" attribute at the top-level group block, will enable content-only editing for that particular pattern. There’s not a way to enabling content-only editing within the block editor (at least not yet), so you’ll have to manually add this to the actual pattern code.

Here’s a gist of the code I used for this post.

I see content-only editing becoming a valuable tool particularly for agencies and freelancers, who can more precisely control the design and layout of block patterns—while also enabling users (whether internally or clients) to change images and text. Even block toolbar controls are condensed when content-only editing is applied.

I’m all for simplifying the WordPress block editor experience, while also enabling those who need the additional design tooling. Content-only editing seems a solid mix to support no/low-code WordPress users, as well as professionals who rely on all the cool new stuff.

What’s your take? I’d love to hear it.

Leave a Reply

Your email address will not be published. Required fields are marked *