I want to check plugin version using following API


For that how can I get Slug of All Active Plugins ?

3 Answers 3


Use option active_plugins to get all plugin init files. e.g.

$current = get_option( 'active_plugins', array() );
// print_r( $current );

Here, htmlpress is the plugin slug.

enter image description here


You can use this code:


// Check if get_plugins() function exists. This is required on the front end of the
// site, since it is in a file that is normally only loaded in the admin.
if ( ! function_exists( 'get_plugins' ) ) {
    require_once ABSPATH . 'wp-admin/includes/plugin.php';

$all_plugins = get_plugins();

print_r( $all_plugins);


        [hello-dolly/hello.php] => Array
                [Name] => Hello Dolly
                [PluginURI] => http://wordpress.org/extend/plugins/hello-dolly/
                [Version] => 1.6
                [Description] => This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
                [Author] => Matt Mullenweg
                [AuthorURI] => http://ma.tt/
                [TextDomain] => 
                [DomainPath] => 
                [Network] => 
                [Title] => Hello Dolly
                [AuthorName] => Matt Mullenweg


Reference: https://codex.wordpress.org/Function_Reference/get_plugins


If your are not on a multisite installation, you can have activated plugins with this code :

$active_plugins = get_option( 'active_plugins', array() );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.