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

When developing a WordPress theme or plugin, it can be really useful to be able to know if a specific plugin is activated. Here is a simple way to check wheher a plugin is activated or not.

Just paste the code below in your theme file, wherever you’d like to check out if a plugin is activated or not. Update the code with the plugin directory and name on line 4.

   include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

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

Thanks to Jean galea for this brillant tip!


  1. Hey there.
    I just used some kind of a similar method to check if a script is enqueued.
    So i found wp_script_is.


    Didn’t know that you can check even for Plugins.
    Thanks for that!

  2. Stupid question, but can you elaborate on why do this?

  3. Great share, I have wasted my own time many times installing plugins that were not updated anymore. Thanks for the info.

Leave a Comment

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