Skip to content

WordPress widget areas in block themes — bridging the legacy gap

A WordPress block theme replaces widget areas with template parts, breaking sites that depend on the legacy widget admin. How to migrate widget content cleanly.

A WordPress site moves from a classic theme to a block theme — Twenty Twenty-Two onward, or a custom theme.json-based theme — and the editorial team notices the Appearance > Widgets screen has vanished. Widget content from the classic theme (sidebar callouts, footer link columns, signup forms) needs to live somewhere; the new theme’s template parts are the answer, but the migration is not automatic.

What’s happening

A classic WordPress theme declares widget areas through register_sidebar(), displays them with dynamic_sidebar(), and the user fills them through the widgets admin. Block themes do not call register_sidebar() — they declare template parts in theme.json and render them through block patterns. The Appearance > Widgets screen disappears because there are no registered sidebars to populate.

WordPress core ships the Widget Block (core/legacy-widget) to wrap legacy widgets inside the block editor — useful for one-offs but not a migration strategy. The real migration: identify what each widget did, rebuild it as a block (or a block pattern), and place it in the appropriate template part.

How to verify

wp eval 'print_r( $GLOBALS["wp_registered_sidebars"] );' | head -30
wp option get sidebars_widgets | head -20
wp eval 'print_r( get_option("widget_text") );' | head -40

wp theme list --status=active --fields=name,version
wp theme get $(wp theme list --status=active --field=name) --field=name
ls -la /home/example/public_html/wp-content/themes/your-block-theme/parts/

If sidebars_widgets contains data but the current theme is a block theme, you have orphaned widget content that no template is rendering.

The fix

  1. Inventory before migrating. Export the current widget content: wp option get sidebars_widgets, then for each registered widget ID, fetch its content with wp option get widget_text (or the matching widget type). This is your migration source-of-truth.
  2. Map widget areas to template parts. A classic theme’s “Sidebar Main”, “Footer 1”, “Footer 2” maps to block-theme template parts you create in parts/sidebar.html, parts/footer-col-1.html, etc. The mapping is editorial, not mechanical.
  3. Use block patterns for repeatable widgets. A “Newsletter signup” widget becomes a block pattern published in your theme. Edit it in one place; insert it wherever needed. Patterns are the block-theme replacement for shared widget content.
  4. Keep the Legacy Widget block for plugin widgets. Plugins (Mailchimp for WordPress, Contact Form 7) often register widgets but not blocks. The Legacy Widget block lets you place them inside template parts as a bridge until the plugin ships a block version.
  5. Remove the widgets admin entirely if not needed. remove_theme_support( 'widgets-block-editor' ) and unregistering all sidebars cleans up the admin. Less attack surface, less confusion for the editorial team. The enterprise WordPress support operating model handles the classic-to-block transition with a content audit before code lands.

Stack Harbor’s enterprise WordPress support operating model includes the classic-to-block theme migration as a planned project, not an in-place toggle. When the editorial team has lost half their tools because the new theme dropped widget areas, start the conversation.