Wp plugin get (WP-CLI)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
$ wp help plugin get


  wp plugin get


  Gets details about an installed plugin.


  wp plugin get <plugin> [--field=<field>] [--fields=<fields>] [--format=<format>]


    The plugin to get.

    Instead of returning the whole plugin, returns the value of a single field.

    Limit the output to specific fields. Defaults to all fields.

    Render output in a particular format.
    default: table
      - table
      - csv
      - json
      - yaml


    $ wp plugin get bbpress --format=json
    {"name":"bbpress","title":"bbPress","author":"The bbPress
    Contributors","version":"2.6-alpha","description":"bbPress is forum software with a twist from the creators of

This might come handy, e.g., if I need to know the version of a plugin, prior to 'manual' updates.



$ wp plugin get wp-rocket
| Field       | Value                                  |
| name        | wp-rocket                              |
| title       | WP Rocket                              |
| author      | WP Media                               |
| version     |                               |
| description | The best WordPress performance plugin. |
| status      | active                                 |

To fetch only the version. Note that the output isn't formatted as a table. That might come handy:

$ wp plugin get wp-rocket --field=version

To see --fields vs. --field in action:

$ wp plugin get wp-rocket --fields=name,version
| Field   | Value     |
| name    | wp-rocket |
| version | 3.15.4    |

Ah, I get it: With --field, output is without formatting, as it is quite clear that this value will be further processed. However, if you do want a nice ASCII-table around your output of only one field, use --fields with only one argument:

$ wp plugin get wp-rocket --fields=name
| Field | Value     |
| name  | wp-rocket |