Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Remove the Inactive Widgets in WordPress

Last updated on by
Follow WPBeginner on YouTube
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).


Editorial Staff at WPBeginner is a team of WordPress lovers led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »
  • Carla

    Hmmm … It doesn’t work for me :(

  • Luke

    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.

  • Bob S

    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.