With Rocket.net's unique WordPress Command Line Interface Terminal, using WP-CLI has never been easier! No longer do you need to a Linux pro in order to make use of the powerful WP-CLI tool set. Before starting, please read the release announcement of the at the Rocket.net Blog for an overview of the WP-CLI Terminal and some basic information about how to use it.
Locating the Rocket.net WP-CLI Terminal
To start, log into https://control.rocket.net and click Manage for the site you'd like to work on. Locate the Advanced icon as sown below. The second option from the top will be WP-CLI, also shown below:
Click on WP-CLI, and you'll be presented with the WP-CLI Terminal:
The WP-CLI Terminal is not the same as an SSH command prompt. The only command available is "wp" with another command called an "argument" after it. In the screenshot below, you can see how these commands work:
wp theme list
wp plugin list
wp user list
"wp" is used to invoke WP-CLI, and "[item] list" was used to display lists of each of those items as shown below:
One of the most powerful tools available in the WP-CLI Terminal is the search-replace command, which allows you to search the database for any text and replace it. In the example below, it is being used to change references from an old domain name to a new domain name.
| Note: This should not be used for changing a site's domain name. The example given refers to an arbitrary URL in the database. |
The output produced shows how many changes were made, and in which tables:
This example did not produce any results, since 0 replacements were made.
In some cases, you may need to use the options "--all-tables" and "--precise" to tell WP-CLI to search the entire database. In this case you may wish to add "--dry-run" at the end, so that you can test the effectiveness of the command without making any actual replacements.
Of course, if you run into any trouble with the WP-CLI Terminal, please use the button in the bottom right corner to open a conversation with one of our amazing Support staff. We'll be glad to help!
Comments
0 comments
Please sign in to leave a comment.