Skip to content

Managing WordPress from the command line with the cPanel WP Toolkit

The WP Toolkit in cPanel includes a command‑line utility (wp-toolkit) that allows you to perform WordPress administrative tasks directly from the terminal. This is especially useful for developers and system administrators who prefer automation or need to manage multiple WordPress sites efficiently.

  • Faster than navigating through the cPanel interface.
  • Automate repetitive tasks with scripts or cron jobs.
  • Manage multiple WordPress installations at once.
  • Access advanced features not always available in the GUI.

Displays available commands and options.

wp-toolkit --help
wp-toolkit --list

Shows all WordPress sites managed by WP Toolkit, including paths, versions, and URLs.

wp-toolkit --info -instance-id X

Replace X with the installation ID. Outputs details such as:

  • Installation path
  • Website URL
  • WordPress version
  • Admin email
  • Security status
  • Installed plugins and themes

You can group plugins and themes into sets for easier deployment.

  • Add a plugin to the cache:

    wp-toolkit --plugins -operation add -source-url https://downloads.wordpress.org/plugin/hello-dolly.1.7.2.zip
  • Add a theme to the cache:

    wp-toolkit --themes -operation add -source-url https://downloads.wordpress.org/theme/twentytwenty.1.8.zip
  • Create a set:

wp-toolkit --sets -operation add -name Basic
  • Install a set on a WordPress site:
wp-toolkit --sets -operation install -set-id 7 -instance-id X
wp-toolkit --smart-update -operation enable -instance-id X

Enables Smart Updates, which test updates on a cloned site before applying them live.

  • Back up:
wp-toolkit --backup -operation backup -instance-id X

Creates a .tar.gz backup file.

  • Restore:
wp-toolkit --backup -operation restore -instance-id X -filename backupfile.tar.gz
wp-toolkit --site-admin-reset-password -admin-login username -instance-id X

Generates a new password for the specified admin account.

Example: Daily backup at 2:15 AM

15 2 * * * /usr/local/bin/wp-toolkit --backup -operation backup -instance-id X >/dev/null 2>&1