wp-content » plugins » Display all Active WordPress plugins

Display all Active WordPress plugins

Here is a simple WordPress plugin that will create a [activeplugin] shortcode:

<?php
/**
 * Plugin Name: Display Active Plugins
 * Plugin URI: https://wpxss.com
 * Description: Display all Active WordPress plugins in a [activeplugins] shortcode
 * Author: Stefan Pejcic
 * Version: 1.0
 * Author URI: https://wpxss.com
 */

add_shortcode( 'activeplugins', function(){
	
	$active_plugins = get_option( 'active_plugins' );
	$plugins = "";
	if( count( $active_plugins ) > 0 ){
		$plugins = "<ul>";
		foreach ( $active_plugins as $plugin ) {
			$plugins .= "<li>" . $plugin . "</li>";
		}
		$plugins .= "</ul>";
	}
	return $plugins;
});

Add it as plugin and activate, then add shortcode [activeplugins] anywhere on your website and it will display all active plugins:

image 4 - Display all Active WordPress plugins
active plugins - Display all Active WordPress plugins
See also  How to Backup a WordPress site using Softaculous

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended