
When working with lots and lots of plugins, it can be useful for developers to be able to check if a particular WordPress plugin is active or not. Just read this recipe to find out.

When working with lots and lots of plugins, it can be useful for developers to be able to check if a particular WordPress plugin is active or not. Just read this recipe to find out.
If you want to check if a WordPress plugin is active, just use the is_plugin_active() function. The function takes a single parameter, which is the path to the plugin, as shown in the example below:
<?php
if (is_plugin_active('plugin-directory/plugin-file.php')) {
//plugin is activated
}
?>
10 Responses
Wow… “The” easy way. Nice to know that, because sometimes my themes depends of plugins, so with this I can warning my users.
Thanks a lot!
Wow, that really is easy
I tend to check for the existence of the functions I use in case the plugin gets updated and the function names changed.
Since you can’t be sure about the path to the main plugin-file, I consider checking via “function_exists()” or “class_exists()” much more reliable.
Thanks for the tip..Your tip are small but very useful..Retweeted it
Thanks for this simple yet very useful recipe. I don’t like to overload my blog with too many plug-ins but this tip would certainly be helpful in maintaining them.
Nice Tip!
Trackbacks: