Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Remove the Inactive Widgets in WordPress

One of our users asked us if it was possible to remove inactive widgets in WordPress. Once you have tried out different themes and played along with many plugins, you will notice that a number of inactive widgets would start accumulating in your inactive widget area. When you stop using a widget or change a theme, your widgets are moved to inactive widgets area. This is done primarily to make sure that you don’t lose your widgets when changing WordPress themes. Removing inactive widgets manually takes some time because you have to click on each widget to open the drop down box containing the link to delete that widget. In this article we will show you how to remove inactive widgets in WordPress.

First thing you need to do is install and activate the Remove Inactive Widgets plugin. After activating the plugin, go to Appearance » Widgets. Inside the inactive widgets box you will see a button labeled Remove Inactive Widgets. Pressing the button will remove all your inactive widgets without even reloading the page.

Removing inactive widgets in WordPress

For those who don’t like the plugin method, you can simply paste the following code in your theme’s functions.php file. All you have to do after that is reload the widgets page, and all your inactive widgets will be gone. Don’t forget to remove this code once you are done.

$widgets = get_option('sidebars_widgets');
$widgets['wp_inactive_widgets'] = array();
update_option('sidebars_widgets', $widgets);

We hope that this article helped you in removing inactive widgets in WordPress. If you have any questions related to this, then feel free to leave a comment below. For all other questions, please ask us on twitter (@wpbeginner).

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

3 CommentsLeave a Reply

  1. Also, you can click and drag the inactive widgets out of the inactive widget area, and drop them in an empty area of the dashboard, they will just disappear. Handy little trick. Still have to do each one, but it’s a little faster.

  2. It would be great if when you include a code snippet–like the one here–you could include a brief description of what each line does. Thanks.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.