How To Disable the Block Editor Support for Widgets

How To Disable the Block Editor Support for Widgets

WordPress 5.8 brought many changes, and one of these is using Blocks in Widget Areas. The Astra Theme supports the use of a block editor and is fully compatible with the mentioned changes. This document will help you if you need to disable Block Editor for Widgets.

Though it』s a great feature, some users might still need this to be reverted to the previous widget editor. You can disable Astra』s Block Editor support for widgets by using a custom code provided in this document. Let』s show you how to do it.

Why Did This Happen?

WordPress version 5.8 came with a large number of improvements and changes, making a large leap forward for both WordPress and its Block Editor.

Using the Block Editor to manage Widget areas makes it easier to add different blocks to any widget area without coding or using shortcodes.

Having that Astra is fully compatible with this change, you』ll be able to use blocks directly with Astra Customizer options too, including the Header and Footer Builder.

How To Change This?

If for any reason you need to revert this to the previous Widget editor, you can disable Astra』s block editor support for widgets by adding a custom code.

You can add the following custom code to the functions.php file of your Child Theme:

add_action( 'after_setup_theme', 'astra_remove_theme_support' );
function astra_remove_theme_support() {
remove_theme_support( 'widgets-block-editor' );
}

If you don』t have your Child Theme installed, please check this article on how to do it. If you are not sure how to add this code, please check this article.

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注