Manage Jetpack via WP-CLI

Learn to manage Jetpack via the WP-CLI commands and configure your Jetpack options and features.

Jetpack has built-in support for WP-CLI, allowing you to modify your Jetpack installation with just a few commands. You’ll need SSH access and a basic understanding of command-line tools.

Main commands

  • wp jetpack
  • wp jetpack status [<full>]
  • wp jetpack module <list|activate|deactivate|toggle> [<module_name>]
  • wp jetpack options <list|get|delete|update> [<option_name>] [<option_value>]
  • wp jetpack protect <whitelist> [<ip|ip_low-ip_high|list|clear>]
  • wp jetpack reset <modules|options>
  • wp jetpack disconnect <blog|user> [<user_identifier>]

wp jetpack status

wp jetpack status [<full>]

With this command, you get the details about your Jetpack setup.

  • wp jetpack status : get basic Jetpack details.
  • wp jetpack status full : get full details, including the Jetpack version, WordPress version, and more.

wp jetpack module

wp jetpack module <list|activate|deactivate|toggle> [<module_name>]

Interact with individual modules via this command: you can Activate, Deactivate, Toggle, and List.

  • wp jetpack module list : list all modules and their status (Activated or Deactivated).
  • wp jetpack module activate stats : will activate the Stats module.
    • wp jetpack module activate all : will activate all modules.
  • wp jetpack module deactivate stats : will deactivate the Stats module.
    • wp jetpack module deactivate all : will deactivate all modules.
  • wp jetpack module toggle stats : will toggle the Stats module on/off.

wp jetpack options

wp jetpack options <list|get|delete|update> [<option_name>] [<option_value>]

This is the command to manage the Jetpack options.  You can list all your Jetpack options and their values, get individual option values, update some options, and delete non-essential ones.

  • wp jetpack options list : list all Jetpack options and their values.
  • wp jetpack options get <option_name> : get the value of a specific option.
  • wp jetpack options delete <option_name> : delete a specific option, but only those not essential to your connection to WordPress.com.
  • wp jetpack options update <option_name> <option_value> : update an option with a new value. Please note that it only works for string option values.

wp jetpack reset

wp jetpack reset <modules|options>

This command resets your Jetpack environment to its default state. You can reset all Jetpack options or revert to the default active modules.

  • wp jetpack reset modules : resets modules to default active state.
  • wp jetpack reset options : resets options to default state, as if you just connected for the first time.  Please note that it also resets modules to default.

wp jetpack disconnect

wp jetpack disconnect <blog|user> [<user_identifier>]

You can disconnect Jetpack from WordPress.com or unlink a user’s account from their WordPress.com connection.

  • wp jetpack disconnect blog : will disconnect Jetpack from WordPress.com.
  • wp jetpack disconnect user <id|email|username> : will unlink their user account from WordPress.com.

wp jetpack protect

wp jetpack protect <whitelist> [<ip|ip_low-ip_high|list|clear>]

Allowlist an IP address from Protect with this command.

  • wp jetpack protect whitelist list : will list your current allowlist.
  • wp jetpack protect whitelist clear : will clear your current allowlist.
  • wp jetpack protect whitelist <ip_address> : allowlist a single IP address.
  • wp jetpack protect whitelist <ip_low-ip_high> : allowlist a range of IP addresses.

Still need help?

Please contact support. We’re happy to advise.

Comments Off on Manage Jetpack via WP-CLI

Jetpack for developers

If you’re a developer, Jetpack includes tools to extend and customize Jetpack to fit your needs.

Work in your local environment with Jetpack

When working on a theme or a plugin in your local environment, you can enable the Jetpack Development mode to use features that do not require a connection to the WordPress.com servers.

To use Jetpack in Development mode, you can add the following code to your wp-config.php file:

define( 'JETPACK_DEV_DEBUG', true );

Learn more about Jetpack Development mode.

Your themes and Jetpack

When developing a new theme, you can include several features that come bundled with Jetpack:

You can also use this dependency script to inform your users that their theme relies on certain Jetpack features and help them install or activate them as needed.

Your plugins and Jetpack

If you’re working on a WordPress plugin, check our tips and tricks for interacting with the Jetpack plugin. We also have instructions on how to use the Code Snippets plugin along with Jetpack.

Integrate WordPress with Jetpack

The JSON API module allows you to build a link between WordPress and your applications.

Klout and StackEdit are examples of apps that can interact with your Jetpack site through the JSON API module.

Contribute to Jetpack

If you want to help us build Jetpack and improve and contribute to the plugin, follow our contributor guide.

Still need help?

Please contact support. We’re happy to advise.

Comments Off on Jetpack for developers
  • Enter your email address to receive news and updates from Jetpack

  • Join 99.1K other subscribers
  • Browse by Topic