How to restore classic widget in WordPress? – Learn WordPress from a to z

Tutorials 0 lượt xem

After updating to WordPress 5.8, you may have noticed that WordPress has brought a big change in widget management. You can now add widgets using the Gutenberg block editor and the classic widget editor has been disabled. Therefore, in this article, I will show you how to restore the classic WordPress widget.

Why do you need to restore the classic widget in WordPress?

can give two main reasons as follows:

The new editor based on blocks is quite cumbersome. And sometimes difficult to use for some users.

Widget blocks will make your admin interface take longer to load. Because block widget will send more requests (requests), thus will increase page load time. For example: On my website, there will be 234 requests for block widgets and 123 requests for classic widgets. For block widget, loading time is up to 2.3s while classic widget only takes 1.1s.

If you feel yourself encountering one of the above two situations. Then here are the two easiest and fastest ways for you to return to the previous widget.

How to restore classic widget?

Use Classic Widgets plugin

classic widget plugin

Classic Widgets plugin developed by the WordPress team restores the previous widget settings screen. The plugin description page says that this plugin can be maintained and supported until at least 2022.

You do not need to make any further adjustments after installing this plugin. Just enable it and your widgets will be restored to the classic way.

Restore the classic widget with the help of Code Snippet

plugin code snippet

If you don’t want to use a plugin for such simple things you can tweak it yourself. Just take the code below and add it to your theme’s functions.php file.

// Disables the block editor from managing widgets in the Gutenberg plugin.
add_filter( 'gutenberg_use_widgets_block_editor', '__return_false' );
// Disables the block editor from managing widgets.
add_filter( 'use_widgets_block_editor', '__return_false' );
<div>
<span>1</span><span>2</span><span>3</span><span>4</span>
</div>

Or you can use Code Snippet to add all the code snippets. This way, I can be sure that if you switch themes in the future, all the code will still be in place and work properly.

Epilogue

hopes with these two methods, it can help you restore the classic widget quickly.

If you find it interesting, you can follow the  WordPress basics section  to know more new knowledge.

Follow fanpage to receive the latest posts:  Group

Bài viết liên quan