DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

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



  1. It’s important to note that this function is found in plugin.php which is not always included. If you want to use this function from within a template or another plugin, you will need to manually require plugin.php.

  2. One down side of is_plugin_active() is that it depends on the exact path to the plugin being correct. It’s not all that unusual for someone to rename a plugin’s folder, which would break this test. It’s something to at least consider depending on how important the presence of an active plugin is to what you’re trying to accomplish.

Leave a Comment

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