Content-only block editing in WordPress

Banner for article about content-only block editing in WordPress

As WordPress continues to expand with a variety of blocks and patterns, there is a need for a simplified editing experience.

The introduction of the new template locking mechanism in WordPress 6.1, known as “content-only editing”, addresses this need. This feature enhances the user interface, making it much cleaner by allowing users to focus on content editing.

Content-only editing vs. Block locking

Besides the content-only editing mode, there is also a feature known as block locking. However, it’s essential to understand that these two mechanisms are distinct from one another:

  • Block Locking: Disables a block from being moved or removed without considering the type of block or editor experience.
  • Content-only Editing: This mechanism operates at the pattern level. When applied to a block pattern, it ensures only content blocks (e.g., text, images) are editable, while design controls are hidden. This results in a clean interface with fewer options, focusing primarily on the content.

Blocks supporting content-only editing

In WordPress, content-only editing mode primarily focuses on content, to simplify the editor interface by stripping away design controls while still allowing content edits.

However, not all blocks support this feature. At the moment of writing this article, the following blocks has support for the content-only editing mode:

  1. Group Block:
    • Purpose: The Group block acts as a container that groups other blocks together. This is particularly useful for applying shared styles or creating complex layouts.
    • Content-Only Editing: When the Group block is set to content-only mode, users can edit the text or images contained within the group but are restricted from making layout or style changes.
  2. Cover Block:
    • Purpose: This block allows users to set images, videos, or gradients in the background, with text content overlaid on top. It’s handy for creating headers or sections with a strong visual presence.
    • Content-Only Editing: In this mode, users can modify the overlay text, but the background media (whether it’s an image, video, or gradient) and other design elements remain unchanged.
  3. Column Block:
    • Purpose: The Column block lets users create flexible multi-column layouts. Each column acts as an individual container for other blocks.
    • Content-Only Editing: With content-only editing applied, the content within each column (e.g., text, images) can be edited. However, the number of columns, their widths, and other design configurations are locked.

Implementation

To enable content-only editing for a specific pattern, the "templateLock": "contentOnly" attribute must be set at the pattern’s top-level group block.

In practice, when a pattern has this attribute and someone activates that pattern in the block editor, it removes design tools from the sidebar panel and emphasizes content blocks.

If website administrators wish to access the full editor view with all block controls, they can press the “Modify” toolbar control. Clicking “Done” will re-enable the content-only mode.

Benefits

The content-only editing mode simplifies the user interface (UI), reducing overwhelming design controls and promoting a clutter-free editing environment.

Besides that, agencies and freelancers can maintain design consistency while giving the flexibility to change text and images.

Disadvantages

While the mode streamlines the editing experience, it may also limit the creative freedom of users who might want to make design changes beyond just content edits.

People who familiar with the full range of WordPress editing tools might find the content-only mode initially confusing or restrictive.

For instance, if individuals who interact with WordPress don’t know that a webpage has activated the content-only mode, they might waste time trying to access hidden controls, which can lead to potential frustration.

Use case

Themes Harbor runs on ProWP block theme.

While initial versions of the theme offered pre-made patterns with content-only mode for various webpage sections, it wasn’t as time-saving as anticipated.

The idea was to speed up the content creation process. However, in practice, it slightly decelerated the process. Editors often found the need to tweak the section, requiring extra steps to activate the full editing mode.

As a result, due to challenges mentioned in the Disadvantages section, the ProWP block theme has since chosen to discontinue patterns with the content-only mode enabled.