WP-CLI
Table of Contents
WP-CLI is a powerful command-line utility for managing WordPress. Every WordPress application hosted on our platform support WP-CLI.
To start with WP-CLI, login into SSH and type:
wp --version WP-CLI 0.24.1
Full command list can be found on WP-CLI official page. Below you can find few examples.
To check your current WordPress version:
wp core version 4.5.2
To install a plugin:
wp plugin install bbpress
To activate the plugin:
wp plugin activate bbpress
To list your plugins:
wp plugin list +-------------------------------------+----------+-----------+---------+ | name | status | update | version | +-------------------------------------+----------+-----------+---------+ | bbpress | active | none | 2.5.10 | | closte | active | available | 2.0.3 | | custom-permalinks | inactive | available | 0.7.21 | | fluid-responsive-slideshow | inactive | available | 2.2.8 | | litespeed-cache | active | none | 1.0.10 | | migrate-to-liquidweb | active | none | 1.30 | | quick-pagepost-redirect-plugin | active | none | 5.1.8 | | thumbnails-regenerate | inactive | none | 2.0.5 | | simple-full-screen-background-image | inactive | none | 1.2 | | slideshow-satellite | inactive | none | 2.4 | | speed-booster-pack | inactive | none | 2.8 | | wd_shortcode | inactive | none | 1.1 | | woocommerce | active | available | 2.5.5 | | woocommerce-all-currencies | active | available | 1.0.2 | | woocommerce-checkout-field-editor | active | none | 3.7 | | woocommerce-multilingual | active | available | 3.8.2 | | woocommerce-nlb | active | none | 0.1.0 | | woocommerce-payment-gateway | active | none | 1.7.6 | | wpml-media | active | none | 2.1.20 | | sitepress-multilingual-cms | active | none | 3.3.7 | | wpml-string-translation | active | none | 2.3.7 | | wpml-translation-management | active | none | 2.1.6 | | wpml-widgets | active | none | 1.0.4 | | wptouch | active | available | 4.1.8 | | wordpress-seo | active | available | 3.4 | | zm-ajax-login-register | active | none | 2.0.2 | +-------------------------------------+----------+-----------+---------+
Search and replace HTTP with HTTPS
Always backup your site before using a command that changes database e.g search-replace command.
wp search-replace 'http://domain.com' 'https://domain.com'
Search and replace old-domain.com with new-domain.com
wp search-replace '//old-domain.com' '//new-domain.com'
Search and replace old-domain.com with new-domain.com in entire multisite network
wp search-replace '//old-domain.com' '//new-domain.com' --network
Nearly all common WordPress functions are available in wp-cli for a full list and updates of new commands that become available you can check the official wp-cli website.