How to Tell if Your WordPress Widget is Active

Check your  widget activation & settings

Also, How to Check Plugin Status

Ever wonder if your widget is activated on an external site?

Here’s how to find out.

When you register a sidebar widget, you use code like this:

register_sidebar_widget(array('Name of Widget', 'class-of-widget'), 'widget_function');

If you want to check whether the widget is activated (you may want to for a variety of reasons), you can do it like this (the “class-of-widget” value from above will be used in the code below): if(isset($_REQUEST['check_status'])) {
if(is_active_widget('class-of-widget')) {
echo 'Active';
} else {
echo 'Inactive';
} // End if 'is_active_widget'
} // End if 'check_status'

Now, simply browse to your widget’s location and add the variable “check_status” at the end: (wp-content/plugins/your-plugin/widget.php?check_status). You will then see the plugin/widget is “Active” or “Inactive.”

I hope someone finds this useful; if you’re in plugin or widget development for WordPress, try the code out!

Author: Zack Katz

Zack Katz is the creator of GravityView and the President of Katz Web Services. He lives in Denver with his wife and cute beast of a cat.

4 thoughts on “How to Tell if Your WordPress Widget is Active”

  1. hi this is naqvi,
    I am new to wordpress and not very much familiar with SEO,
    I just added wordspinner in my blog. but how i could add tags meta data key word and title in my pages.  I mean syntax and where i have to add these entries.

Leave a Reply

Your email address will not be published. Required fields are marked *