• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

nSiteful Web Builders

Building a Better Web - One Site at a Time.

  • Home
  • About
    • Testimonials
    • Resources
    • Partner With Me
    • Frequently Asked Questions
  • Web Sites
  • Online Marketing
  • WordPress Support
    • Customized WordPress Training
    • 60-for-60 Sessions
  • Web Applications
  • Blog
    • At-A-Glance
    • Blog Articles Grouped by Category
    • Case Studies
    • General
    • Portfolio
    • Reviews
    • Snippets
    • Techniques
    • Projects
  • Contact
    • Purchase Retainer Consulting Hours
    • About Retainer Consulting Hours
    • Book a Meeting with Jeff
    • Tell Me About Your Web Project
    • nSiteful Newsletter Archives
    • nSiteful Rewards
Listing of active plugins in WordPress dashboard

By Jeff - 2/16/2025
Cats: Snippets · Tags: php, WordPress

snippets

Display List of Active Plugins in WordPress Dashboard

This question came up in one of the WordPress-related Facebook groups I belong to.

The poster wanted to allow selected registered WordPress users to see a list of active plugins without giving them the capability of managing (adding, editing, activating, deactivating, deleting) any plugins. He was thinking about creating a new custom WordPress role and then customizing capabilities. That would work. However, adding a script with the following code snippets to a file in the mu-plugins folder is a lot easier.

I’m indebted to Boopathi Rajan, on whose website I found these code snippets.

Here’s what the listing looks like:

Listing of active plugins in WordPress dashboard
Screen shot of WordPress dashboard widget displaying listing of active plugins

Summary of steps:

  1. Create a PHP file called something like show-my-plugins.php
  2. Add the two snippets (see below) to the file.
  3. Upload the file to the /wp-content/mu-plugins/ folder.

Code to set up the dashboard widget:

/* Initializes a new dashboard widget */
function nwb_dash_widget_plugins_init() {
	if( current_user_can('manage_options') ) {
		wp_add_dashboard_widget(
		'nwb_dash_plugins',						// Widget slug
		'* Installed/Active Plugins (nwb)',		// Widget title
		'nwb_dash_widget_plugins_content',		// Callback to function that has the content
		);  
	}
}

Notes:

  • Line 3: Change manage_options — which is a capability only Administrators and Super Adminstrators have — to a capability appropriate for your target audience. For example, use read to allow Contributors to see the listing. Details on WordPress roles and capabilites here.
  • Line 7: This calls the function that generates the content.

Notice that the code on line 7 is what calls the function that generates the content.

Code to generate the content of the dashboard widget:

/* Generates the content of the new dashboard widget */
function nwb_dash_widget_plugins_content() {
	$plugins = get_plugins();
	?>
	<div class="wrap">
		<table class="nwb-list-plugins">
			<thead>
				<tr>
					<th>Plugin Name</th>
				</tr>
			</thead>
			<tbody>
				<?php
				$sno=1;
				if($plugins) {
					$counter = 0; 
					foreach($plugins as $key=>$plugin) {
						if($plugin['TextDomain']!='export-plugin-details') {
							$version_latest='-';
							$args = array(
								'slug' => $plugin['TextDomain'],
								'fields' => array(
									'version' => true,
								)
							);
						if ( function_exists('plugins_api') ) {
							$call_api = plugins_api( 'plugin_information', $args );
							/** Check for Errors & Display the results */
							if ( is_wp_error( $call_api ) )  {							
								$api_error = $call_api->get_error_message();
							} else {
								if ( ! empty( $call_api->version ) ) {
									$version_latest = $call_api->version;
								}
							}
						}
							if(is_plugin_active($key)) {
								$counter ++;
								$counter_cos = str_pad($counter, 3, '0', STR_PAD_LEFT);
								echo "<tr>";
								echo "<td><code>" . $counter_cos . '</code>' . $plugin['Name']."</td>";
								echo "</tr>";
							}
						}
					}
				}
				else {
					echo "<tr><td colspan='4'>No Plugins found..</td></tr>";
				}
				?>
			</tbody>
		</table>
	</div>
	<?php
}
add_action('wp_dashboard_setup', 'nwb_dash_widget_plugins_init');

Notes:

  • Line 26: I had to add this because, in one installation, I was encountering a fatal error telling me the plugin didn’t exist. I never dug too deep to figure that out, and now the listing works wherever I’ve added it.
  • Line 56: This add_action call starts everything in motion, associated with the wp_dashboard_setup hook.

Like what you see? Share with others and join my mailing list. No long-term commitment, unsubscribe any time.

Related Posts

  1. Decisions
  2. Dive Into WordPress Custom Post Types – Part 3
  3. Underlining for Emphasis: How to un-underline text on a Web page with CSS
  4. Bad News: Facebook is Converting Old Groups to New Format
  5. Help Your Blog Readers Find What They’re Looking For with the Search & Filter Plugin

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar

mailchimp signup

Subscribe to get notified when new articles are published. Unsubscribe any time. No spam. I promise. Check out my newsletter archives.

social

Twitter Facebook LinkedIn

Recent Articles

  • Post-Specific CSS for WordPress October 5, 2026
  • You built an online course, but they haven’t come. September 16, 2026
  • Custom MemberPress Pricing Pages December 19, 2025
  • CSS Data Attribute Override December 11, 2025
  • MemberPress Rules Using Custom Taxonomies and Custom Roles December 10, 2025

Filter By Category/Tag

Categories

  • Case Studies (8)
  • For Staff (1)
  • General (73)
  • Portfolio (7)
  • Reviews (14)
  • Snippets (24)
  • Techniques (52)

Popular Tags

Advanced Custom Fields Blogging Child Themes Content Marketing CSS Customer Service Custom Fields Custom Post Types Diagnostics Domain Names Facebook FooGallery Genesis Hosting HTML Images iPhone Libra Live Chat Marketing Media MemberPress MemberPress Courses Membership Sites Mobile-Friendly MySQL Photo Gallery php Pinterest Plugins Post Formats Pricing Project Management SEBA SEO Seth Godin Shortcodes Social Networking Surveys Taxonomies Twitter Video Web design Web forms WordPress

Footer

Background

Web Sites | WordPress Support | Web Applications.

Formally trained in liberal arts and education (I have a B.A. in Government from Harvard and studied Secondary Education at Rutgers Graduate School), I have honed my skills in the communication arts and sciences as a teacher, trainer, instructional designer, writer, photographer, calligrapher, helpdesk manager, database programmer, and multimedia developer.

(I've also been a group counselor, waiter, bartender, bicycle messenger boy, computer salesman, carpenter's helper, financial analyst, and school board president.)

Tech

Systems since 1983.
Web sites since 1994.
PHP since 2001.
WordPress since 2007.

Contact

Book Meeting
770-772-5134
Email Jeff
Send Money
All Ways

Copyright 2026, nSiteful Web Builders, Inc.

Cookies Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}
https://iframe.mediadelivery.net/embed/392008/42d18bc1-2adc-4741-b733-053d08d09c32
https://vz-000c5976-3ab.b-cdn.net/42d18bc1-2adc-4741-b733-053d08d09c32/play_720p.mp4

Receive occasional emails from Jeff