MW
Tutorial

WordPress 7.1 Editor Changes: Iframe, Blocks & DataViews

WordPress 7.1 always iframes the post editor, adds background.gradient and min-width block supports, expands DataViews, and keeps the admin toolbar in the editor.

advanced 22 min Aug 20, 2026
You maintain blocks, editor plugins, or admin-bar nodes You know what the 7.0 iframed-editor rule (API v3) was

WORDPRESS 7.1 EDITOR CHANGES

Most of WordPress 7.1’s editor work is quiet. One change is not: the post editor is always iframed. In 7.0 the iframe dropped if any inserted block was below API version 3. In 7.1 that escape hatch is gone — theme type, registered API versions, and legacy meta boxes no longer matter.

If you skipped the 7.0 breaking-changes tutorial, read this one anyway. The compatibility story just got stricter.

Always-iframed post editor

Site editor, template editor, and device previews have been iframed for years. The post editor was the holdout so older blocks kept working.

Editor iframe status in 7.1
  • Shipped · Site editor
  • Shipped · Template editor
  • Shipped · Device previews
  • Shipped · Post editor (always)

Starting in 7.1 the post editor is iframed regardless of:

  • theme type (classic vs block theme)
  • block API versions of registered blocks
  • block API versions of blocks in the content
  • whether the site still registers legacy meta boxes

Gutenberg 22.6 already forced this when the plugin was active, so many Gutenberg-plugin sites have been living in this world. Core caught up. Details: Iframed Editor Changes in WordPress 7.1 and Gutenberg PR 74042.

The iframe has its own document and window, separate from the admin page where editor scripts run.

— Aki Hamano, Make WordPress Core

What to fix in your blocks

Most blocks already work. Failures share one cause: global document / window.

Canvas document
Wrong
document.querySelector( '.wp-block-my-plugin' )
Right
el.ownerDocument.querySelector( '.wp-block-my-plugin' )
You query the admin page, not the canvas. The node is null.
Window / measurements
Wrong
window.getComputedStyle( node )
Right
node.ownerDocument.defaultView.getComputedStyle( node )
Layout, scroll, and matchMedia read the wrong viewport.
Listeners
Wrong
document.addEventListener( 'click', handler )
Right
useRefEffect to attach on the canvas node and clean up on unmount
Clicks inside the iframe never reach your handler.

Canonical migration notes: Technical considerations for the iframe editor.

If a plugin injects CSS or JS into the admin page and expects it to style the canvas, that CSS never enters the iframe. Enqueue into the editor canvas, or use block supports / Global Styles.

New block supports

WordPress 7.1 adds opt-in design controls through block metadata:

Declare them in block.json supports like any other design tool. The Custom HTML block also improves: supported blocks remain editable inside its preview (dev note).

Query Loop gains an option to exclude the current post (#65373). Pseudo-state styles are no longer applied to the default state (#64838). WP_Block_Type_Registry::register() _doing_it_wrong() messages now include context (#65039).

DataViews, DataForm, and View Config

DataViews and DataForm keep growing. 7.1 adds View Config so you can control which Site Editor screens and layouts are available.

If you build custom data-driven UIs in the editor (pattern lists, product tables, custom post type browsers), read Filtering Site Editor Screens in WordPress 7.1. The practical effect: you can hide or constrain views instead of shipping a fork of the Site Editor chrome.

Editor component library updates (new features, behaviour changes, migrations): Editor components updates and Miscellaneous Editor Changes.

Persistent admin bar

The toolbar now stays available while navigating supported editor screens — front end, wp-admin, Site Editor, Block Editor.

For plugin authors: the Site Editor had no “exit fullscreen” mode, so a persistent toolbar there is new. If you add admin-bar nodes, test them in the Site Editor. Hide them on editor screens if they do not belong:

WP Action admin_bar_menu Priority 100 1 arg: $wp_admin_bar
admin-bar.php
add_action( 'admin_bar_menu', function ( WP_Admin_Bar $wp_admin_bar ) {
  $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;

  if ( $screen && $screen->is_block_editor() ) {
      return; // skip this node in Post + Site Editor
  }

  $wp_admin_bar->add_node( [
      'id'    => 'my-plugin',
      'title' => 'My Plugin',
      'href'  => admin_url( 'admin.php?page=my-plugin' ),
  ] );
}, 100 );

Dev note: Consistent navigation in WordPress 7.1 with persistent toolbar.

Accessibility in the editor chrome

Admin colour-scheme contrast for editor chrome improved (#65382). Core also ships a shared accessible tooltip mechanism (#51006) used on Login “Remember Me” and metabox order buttons — stop using title attributes for supplementary UI. See Introducing name and informational tool tips and Accessibility Improvements in WordPress 7.1.

Post list tables now expose hierarchical relationships to assistive tech (row headers, #64932).

import { useRefEffect } from '@wordpress/compose';

const ref = useRefEffect( ( node ) => {
  const { ownerDocument } = node;
  const { defaultView } = ownerDocument;

  const onClick = () => {
      // canvas-scoped work
  };

  ownerDocument.addEventListener( 'click', onClick );
  return () => ownerDocument.removeEventListener( 'click', onClick );
}, [] );

Next: Global Styles, SVG Icons & Design System — the styling and icon APIs that sit next to these editor changes.

You've completed this tutorial!

Get the next one in your inbox. Practical tips, no fluff.

Subscribe

Get weekly notes in your inbox

Practical tips, tutorials and resources. No spam.