Written by Nikhlesh Kunwar Monday, 26 January 2015 16:44
WP-Cli is a command line interface which allows the users to manage their WordPress web sites from the command prompt. Upgrades can be performed, backups can be generated, new posts can be published and most of the regular admin actions can be performed with a set of commands.
In this tutorial we will explain how to use the WP command line interface in order to complete regular administrative tasks like upgrades, database backup creation, plugins and themes installations and removals, publishing and deleting posts, changing site's URL settings and getting help on chosen commands. Note that WP-Cli requires an SSH access.
First, we will start with the instructions on how to list the available commands and get detailed help for each one of them.
To list all the commands write wp help or just wp.
The following list will be shown:
See 'wp help
If you want to get detailed documentation, for example, for the wp db export command, enter the code listed below:
The result will be as follows:
Now we will proceed with the regular management tasks.
First, we will show how to update the core files of your web site. We will check the current version which we have:
Obviously it is outdated. In order to use the latest scripts features and have all the vulnerabilities in the older versions patched we should always use the latest stable releases for our web site applications. Using WP-Cli we will complete the upgrade with a single command:
The update of the core files and the database are not always enough. If we have integrated external plugins and/or themes we should take care of their upgrade. We need to check the status of the installed extensions:
We have 5 plugins integrated in our sample installation. There are upgrades for two of them. We will complete the upgrades through the following commands:
To install and activate a new plugin run the commands listed below:
You should replace the "Plugin_Name" string with the exact plugin name.
If you do not need a plugin you can remove it through the following action:
Next, we will check the themes:
To update all the themes the following command should be executed:
The themes can be installed, activated and uninstalled in a similar way to the plugins:
The "Theme_Name" string should be replaced with the actual theme name.
The activation will make the chosen theme the default one for your WordPress installation.
We can even write posts directly from the command line. The creation of a sample post on a new page is illustrated below:
If we do not need a certain post we can easily delete it:
Once we have our script upgraded and the content set we can generate a database backup:
If the web master decides to change the primary domain for the WordPress web site he/she can easily update the corresponding URL options:
More details on WP cli can be found through the help command and the project's home page.
|< Prev||Next >|
Royal Developer Top three Web Designing and Web Development Company in Dehradun, Uttarakhand, India. Royal Developer Best SEO Company in Dehradun takes pride in its philosophy of 'Employee First' which empowers to create a real value for the customers. Royal Developer can offer Best and cheap Website Development Software Development & SEO Services. We are the Best service Provider of SEO, SEM, SMO Services Company in Uttarakhand. Web Designing Course in Dehradun, Web Designing Classes in Dehradun, Web Design Training Institute in Dehradun, Web designing institute in dehradun, Best institute for web designing in dehradun, Web development training in dehradun, Web development course in dehradun, Web Designing Training in Dehradun.
|- - Our Services - -|
|- Website Designing||- Website Development||- Bulk SMS|
|- SEO ( Google Promotion )||- SMO ( Facebook, Youtube, Twitter )||- Google Adwords|
|- Bulk Email||- Shared Hosting||- Reseller Hosting|
|- Mobile Website||- VPS Hosting||- Dedicated Hosting|
|- Logo Design||- Shopping Website||- Software Development|
|- Mobile Apps||- Payment Gateway||- SSL Certificate|
|- Domain Registration||- Mobile No. Database||- Email ID Database|
|- Php Readymade Script||- Content Writing||- I.T. Courses|
|- Google Adsense||- Toll Free Number||- Missed Call|