Advanced WordPress Management Using WP-CLI on Alibaba Cloud ECS — Part 1

1. Install WP-CLI on your Alibaba Instance

Login to your server by SSH:

$ chmod +x wp-cli.phar
$ sudo mv wp-cli.phar /usr/local/bin/wp

2. Prepare WordPress installation and User permissions

We will be issuing WP-CLI commands as our user, in my case ‘new_user’. We might run into problems with command that need to write to our website directories if we don’t prepare directory and user groups accordingly.

$ cd /var/www
$ ls -l
$ sudo chmod -R 775 /var/www/an-example-domain.com
$ ls -l

3. WordPress Core Commands

Installing WordPress Core

$ wp core update
$ wp core version

4. Managing WordPress Content

Listing, Creating, Deleting, and Editing Posts and Pages

$ wp revisions clean -1 --post_type=post
$ wp revisions list

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com