wp_instance.exe: WordPress Toolkit

The wp_instance utility is used to manage WordPress installations through CLI. By using this utility, you can perform the following tasks:

  • activating, deactivating, installing, uninstalling, and updating plugins
  • activating, installing, uninstalling, and updating themes
  • setting up autoupdates, checking if updates are available, and updating WordPress installations
  • viewing the list of WordPress installations
  • searching plugins and themes by name
  • viewing the list of plugins and themes installed on a WordPress installation

Usage
wp_instance <command>

Example

The following command activates the plugin with the ID 123 on the WordPress installation with the ID mycms.

wp_instance --activate-plugin mycms -plugin-id 123

Commands
Command Parameter Description Example

--activate-plugin

<WordPress_id>

Activates the plugin specified by the option on the WordPress installation.

Requires the -plugin-id option.

To activate the plugin with the ID 123 on the WordPress installation with the ID mycms:

wp_instance --activate-plugin mycms -plugin-id 123

--deactivate-plugin

<WordPress_id>

Deactivates the plugin specified by the option on the WordPress installation.

Requires the -plugin-id option.

To deactivate the plugin with the ID 123 on the WordPress installation with the ID mycms:

wp_instance --deactivate-plugin mycms -plugin-id 123

--uninstall-plugin

<WordPress_id>

Uninstalls the plugin specified by the option on the WordPress installation.

Requires the -plugin-id option.

To uninstall the plugin with the ID 123 from the WordPress installation with the ID mycms:

wp_instance --uninstall-plugin mycms -plugin-id 123

--update-plugin

<WordPress_id>

Updates the plugin specified by the option on the WordPress installation.

Requires the -plugin-id option.

To update the plugin with the ID 123 on the WordPress installation with the ID mycms:

wp_instance --update-plugin mycms -plugin-id 123

--install-plugin

<WordPress_id>

Installs the plugin specified by the option on the WordPress installation.

Requires the -plugin-id option with the parameter specified without a version.

To install the plugin with the ID 123 on the WordPress installation with the ID mycms:

wp_instance --activate-plugin mycms -plugin-id 123

--activate-theme

<WordPress_id>

Activates the theme specified by the option on the WordPress installation.

Requires the -theme-id option.

To activate the theme with the ID 123 on the WordPress installation with the ID mycms:

wp_instance --activate-theme mycms -theme-id 123

--uninstall-theme

<WordPress_id>

Uninstalls the theme specified by the option on the WordPress installation.

Requires the -theme-id option.

To uninstall the theme with the ID 123 from the WordPress installation with the ID mycms:

wp_instance --uninstall-theme mycms -theme-id 123

--update-theme

<WordPress_id>

Updates the theme specified by the option on the WordPress installation.

Requires the -theme-id option.

To update the theme with the ID 123 on the WordPress installation with the ID mycms:

wp_instance --update-theme mycms -theme-id 123

--install-theme

<WordPress_id>

Installs the theme specified by the option on the WordPress installation.

Requires the -theme-id option with the parameter specified without a version.

To install the theme with the ID 123 on the WordPress installation with the ID mycms:

wp_instance --activate-theme mycms -theme-id 123

--enable-auto-updates

<WordPress_id>

Switches on auto-updates on the WordPress installation.

To switch on auto-updates on the WordPress installation with the ID mycms:

wp_instance --enable-auto-updates mycms

--disable-auto-updates

<WordPress_id>

Switches off auto-updates on the WordPress installation.

To switch off auto-updates on the WordPress installation with the ID mycms:

wp_instance --disable-auto-updates mycms

--update-core

<WordPress_id>

Updates the WordPress installation.

To update the WordPress installation with the ID mycms:

wp_instance --update-core mycms

--remove-instance

<WordPress_id>

Removes the WordPress installation.

To remove the WordPress installation with the ID mycms:

wp_instance --remove-instance mycms

--clear-cache

<WordPress_id>

Refreshes settings of the WordPress installation in WordPress toolkit after the settings were changed through WordPress.

To refresh settings of the WordPress installation with the ID mycms after the settings were changed through WordPress:

wp_instance --clear-cache mycms

--get-list

 

Shows the list of WordPress installations.

To view the list of WordPress installations:

wp_instance --get-list

--search-plugins

<term>

Shows names of plugins containing the specified symbols without versions.

To search plugins containing the symbols example in their name:

wp_instance --search-plugins example

--search-themes

<term>

Shows names of themes containing the specified symbols without versions.

To search themes containing the symbols example in their name:

wp_instance --search-themes example

--get-plugin-list

<WordPress_id>

Shows names and versions of plugins installed on the WordPress installation.

To view the list of plugins installed on the WordPress installation with the ID mycms:

wp_instance --get-plugin-list mycms

--get-theme-list

<WordPress_id>

Shows names and versions of themes installed on the WordPress installation.

To view the list of themes installed on the WordPress installation with the ID mycms:

wp_instance --get-theme-list mycms

--get-security-status

<WordPress_id>

Returns the result of the last security check run on the WordPress installation.

To return the result of the last security check run on the WordPress installation with the ID mycms:

# ./wp_instance --get-security-status mycms

Options
Option Parameter Description Example

-plugin-id

<plugin_id>

Specifies ID of a plugin.

Required for --activate-plugin, --deactivate-plugin, --uninstall-plugin, --update-plugin, --install-plugin commands.

For the --install-plugin command, the <plugin_id> parameter is specified without a version.

To activate the plugin with the ID 123 on the WordPress installation with the ID mycms:

wp_instance --activate-plugin mycms -plugin-id 123

-theme-id

<theme_id>

Specifies ID of a theme.

Required for --activate-theme, --uninstall-theme, --update-theme, --install-theme commands.

For the --install-theme command, the <theme_id> parameter is specified without a version.

To activate the theme with the ID 123 on the WordPress installation with the ID mycms:

wp_instance --activate-theme mycms -plugin-id 123