0

Is it possible to programmatically change the plugin descriptions otherwise provided by the plugin author? The text I've highlighted below is what I'm talking about wanting to change: Plugin description

I often find most plugins have fairly useless descriptions, and it would be useful to use this area to actually describe what we're using the plugin for. None of the plugins (I've tried) that allow you to write notes for other plugins deliver a satisfactory solution.

Any ideas?

2 Answers 2

2

Yes, there is a filter you can use — all_plugins:

apply_filters( 'all_plugins', array $all_plugins )

Filters the full array of plugins to list in the Plugins list table.

And here's an example which changes the description of the Akismet plugin:

add_filter( 'all_plugins', 'my_all_plugins' );
function my_all_plugins( $all_plugins ) {
    // the & means we're modifying the original $all_plugins array
    foreach ( $all_plugins as $plugin_file => &$plugin_data ) {
        if ( 'Akismet Anti-Spam' === $plugin_data['Name'] ) {
            $plugin_data['Description'] = 'My awesome description';
        }
    }

    return $all_plugins;
}

But yes, the above hook runs on the Plugins list table only..

*my_all_plugins is just an example name. You should use a better one..

1
  • 1
    Awesome! This is exactly what I wanted to achieve. Thanks!
    – Fluxian
    May 1, 2021 at 13:31
-2

It is possible by opening plugin directory , in there find file name plugin-name.php , open it with editor and you should see :

/**
 * Plugin Name: Your Plugin
 * Plugin URI:  Plugin Uri (url ) 
 * Description: Your custom description.
 * Version:     1.0.1
 * Author:      Your Name
 * Author URI:  Your Site
 * License:     GPL2+
 * Text Domain: translate-string
 * Domain Path: /languages/
 *
 */
3
  • I'm assuming updating the plugin will break changes made in there?
    – Fluxian
    May 1, 2021 at 11:30
  • You can change plugin description there, it should not affect on plugin's work, more important lines are name, version, text domain and domain path. But if you update this plugin later, original description returns.
    – anton
    May 1, 2021 at 12:00
  • @anton Yeah that's what I thought. I'd want these description changes to stick, and ideally go away if another theme is loaded.
    – Fluxian
    May 1, 2021 at 12:05

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.