Site icon CodeRevolution Knowledge Base

Check if a WordPress plugin is active, the easy way – CodeRevolution

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 } ?> 
Exit mobile version