WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After seeing thousands of useful API functions in the WordPress core, I'm surprised to discover today that there ain't a function that would list the active plug-ins. I don't know you but I'm quite surprised at that.

I was wondering if there is a reason for missing that? If so, I'd like to know about it.

And, if there is a quick PHP snippet you know of that could give you a list of active plugins, ( the same way that a get_post_types('','names'); does for CPT's or get_taxonomies('','names'); does for CTs ), I'd appreciate it if you provide the code.

share|improve this question
up vote 6 down vote accepted



and get_option('active_plugins')

share|improve this answer
Interesting. So we do have such a function. That's good. But check this (google.com/… ) or this (google.com/…) to see how google fails to pick that up. – Average Joe May 15 '12 at 12:22

There multiple WordPress Apis for getting a list of plugins like OTP listed in his answer.

get_plugins() :Check the plugins directory and retrieve all plugin files with plugin data. Returns an array. Note: Only works on the admin side


function list_the_plugins() {
    $plugins = get_plugins();
        foreach ( $plugins as $plugin ) {
        var_dump( $plugin );


  'Name' => string 'WP Coda Slider' (length=14)
  'PluginURI' => string 'http://c3mdigital.com/wp-coda-slider/' (length=37)
  'Version' => string '0.3.2' (length=5)
  'Description' => string 'Add a jQuery Coda slider to any WordPress post or page' (length=54)
  'Author' => string 'c3mdigital' (length=10)
  'AuthorURI' => string 'http://c3mdigital.com/' (length=22)
  'TextDomain' => string '' (length=0)
  'DomainPath' => string '' (length=0)
  'Network' => boolean false
  'Title' => string 'WP Coda Slider' (length=14)
  'AuthorName' => string 'c3mdigital' (length=10)

get_option( 'active_plugins' ) Returns the path relative to wp-content/plugins of the plugin file:


function list_the_plugins() {
    $plugins = get_option ( 'active_plugins', array () );
    foreach ( $plugins as $plugin ) {
        echo "<li>$plugin</li>";


  • debug-bar-extender/debug-bar-extender.php
  • debug-bar/debug-bar.php
  • log-deprecated-notices/log-deprecated-notices.php
  • manage-post-schedule/manage-post-schedule.php
  • wp-coda-slider/wpcodaslider.php

Other API functions related to plugin status:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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