Plugins

by Gisle Hannemyr

This chapter discusses some of the interfaces and tools you may use in the day to day administration of a WordPress website.

Table of contents

WordPress plugins discussed in this chapter: Symple Shortcodes.

Introduction

Extensions to WordPress are called plugins.

Plugins are located in or below the wp-content directory. Regular plugins are located in a subdirectory named plugins. Must Use Plugins are located in a subdirectory named mu-plugins. Drop-in Plugins are located in the wp-content directory.

Installing plugins

Plugins hosted on https://wordpress.org/plugins/ can be installed from the the GUI or the CLI.

Example: Using the CKI to install the latest version from of Search & Replace from wordpress.org and activate:

$ wp plugin install search-and-replace --activate
Installing Search & Replace (3.2.1)
Downloading installation package from https://downloads.wordpress.org/plugin/search-r…
Unpacking the package...
Installing the plugin...
Plugin installed successfully.
Activating 'search-and-replace'...
Plugin 'search-and-replace' activated.
Success: Installed 1 of 1 plugins.

Source WP: wp plugin install.

Plugins hosted elsewhere need to be installed by some other means – often by downloading and unpacking a zip-file in the plugin directory. One example of such a plugin is Symple Shortcodes.

plugins01.png
No auto-updates available for Symple Shortcodes.

List plugins

$ wp plugin list
+--------------------------+--------+-----------+---------+
| name                     | status | update    | version |
+--------------------------+--------+-----------+---------+
| classic-editor           | active | none      | 1.6.2   |
| equal-height-columns     | active | available | 1.1.3   |
| genesis-columns-advanced | active | none      | 2.0.3   |
| soliloquy-lite           | active | none      | 2.6.2   |
| shortcodes-ultimate      | active | none      | 5.11.1  |
+--------------------------+--------+-----------+---------+

It can be filtered on field name. For instance to list only the plugins that have an update available:

$ wp plugin list --update="available"
+--------------------------+--------+-----------+---------+
| name                     | status | update    | version |
+--------------------------+--------+-----------+---------+
| equal-height-columns     | active | available | 1.1.3   |
+--------------------------+--------+-----------+---------+

Source WP: wp plugin list.

Update plugin

To update a single plugin:

$ wp plugin update custom-facebook-feed
Downloading update from https://downloads.wordpress.org/theme/custom-facebook-feed.4.0.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Success: Updated 1 of 1 plugins.
+----------------------+-------------+-------------+---------+
| name                 | old_version | new_version | status  |
+----------------------+-------------+-------------+---------+
| custom-facebook-feed | 2.2         | 4.0         | Updated |
+----------------------+-------------+-------------+---------+

To update all plugins:

$ wp plugin update --all

Deactivate and uninstalling plugins

To uninstall a plugin, first deactivate it from the GUI or CLI, then delete it:

$ wp plugin deactivate hello
$ wp plugin delete hello
Success: Deleted 1 of 1 plugins.

Deactivating makes it no øonger active, deleting removes it from the file system.

Sources: deactivate, delete, Proper, Dummies.

Must Use Plugins cannot be disabled as long as they are in the mu-plugins subdirectory. To disable, first move to the plugins directory, then disable it.

See also Wordpress.SE: How to disable mu-plugins? WPengine: Removing Unused WordPress Plugins.

Final word

[TBA]


Last update: 2021-12-05 [gh].