Check if a WordPress plugin is active, the easy way

September 21, 2009 at 9:12 am

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:

if (is_plugin_active('plugin-directory/plugin-file.php')) {
    //plugin is activated