Managing WordPress from WP-CLI Terminal: Detailed instructions

official-wordpress-tu-terminal-wp-cli

Manage WordPress from Terminal WP-CLI - Needless to say, WordPress will continue to dominate the CMS landscape in the future. This is evident from the increasing number of websites created by WordPress.

Installing WordPress website is very simple. Once done, managing it simply goes to the Admin Panel, checking a few options.

However, managing WordPress website is not simple. It takes countless hours to manage multiple WordPress websites through the admin panel. To go to the personal admin panel, click a few buttons to get the job done.

WordPress is well aware of this situation, providing powerful WordPress command line tool (WordPress CLI to Power users) to manage WordPress website. Using the WordPress CLI command, users can conveniently add, update plugins, create backups, install multiple WordPress sites without having to restore the admin panel button.

In this WP-CLI tutorial, I will start from explaining what WP-CLI is and then give an overview of the basic WP_CLI command.

Requirements for WP-CLI

admin-word-wordpress-tu-terminal-wp-cli

To install WP-CLI, you need a hosting solution that provides SSH access. Many shared hosting providers often do not provide SSH access. However, most popularly managed WordPress cloud storage provide SSH server access.

Therefore, prepare to install WP-CLI, please ensure the environment meets the following minimum requirements:

  • PHP 5.4 and above
  • WordPress 3.7 and above.
  • NIX environment because of limited WP-CLI support in Windows environment

Connect to the root of your website via SSH

I assume you already have SSH server access, the new database. To use SSH access to the server, you need login information, server IP, port.

Note: For this section, I describe dedicated server / VPS

Next, the first important thing you need to do is generate the key pair. Follow the link below for different operating systems:

  • For Windows - PuTTY
  • For Linux - Ubuntu
  • For Mac

For the purpose of this tutorial, I am using PuTTY.

  • In PuTTY, enter the server IP address and port
  • Next, you need to choose SSH
  • Next, click the Open button

admin-word-wordpress-tu-terminal-wp-cli

Next, the process will prompt you to enter the username and password you found in the Server Details area.

word-ly-wordpress-tu-terminal-wp-cli

See more: How to make money from the website

Download, configure WordPress

The next step involves downloading and configuring WordPress through the WP-CLI commands.

admin-word-wordpress-tu-terminal-wp-cli

admin-word-wordpress-tu-terminal-wp-cli

The following command will download the latest version of the WordPress core files.

Configure WP-CLI

Use the following command to create wp-config.php file containing main configuration settings for WordPress website:

admin-word-wordpress-tu-terminal-wp-cli

For the purpose of this article, I used the following database details:

Database name: check

Database Username: wp

Database Password: securepswd

Examples of command options

The command mentioned is just a variant that highlights the WP-CLI power. As you guessed, this creates a standard version of the wp-config file.

The following variant will set up the wp-config file with both WP_DEBUG and WP_DEBUG_LOG

admin-word-wordpress-tu-terminal-wp-cli

There is always a chance that administrator user credentials are stored in the bash shell history. This becomes a serious security breach. WP-CLI provides the wp config command version to solve the problem:

admin-word-wordpress-tu-terminal-wp-cli

Make up the database

Use the following command to create the database. Note that this command will create a new database with the name used in the wp-config file.

admin-word-wordpress-tu-terminal-wp-cli

admin-word-wordpress-tu-terminal-wp-cli

WP-CLI Install WordPress

It is convenient to install WordPress from the command line using WP-CLI on the server. The command requires parameters including the URL, Title, Administrator username, Password, Administrator email.

admin-word-wordpress-tu-terminal-wp-cli

word-ly-wordpress-tu-terminal-wp-cli

WordPress website has been set up successfully.

Managing WordPress interface with WP-CLI

Using WP-CLI, you connect the server directly to the WordPress theme store, enter the interface momentarily. As you might guess, the process of installing and activating the WordPress CLI interface is really simple. You can also update, delete the interface through WP-CLI.

The wp command interface is used in combination with options, switching takes over all interface management tasks.

To install the interface, say Twenty Nineteen, use the following command:

admin-word-wordpress-tu-terminal-wp-cli

Note: Make sure you use the interface name as it appears on the page URL. For example, as you can see in the screenshot, I used twentyninteen as the command argument.

admin-word-wordpress-tu-terminal-wp-cli

The system will generate a notification about the installation in progress.

To activate the interface, type:

width-

WordPress website interface will be changed to Twenty Nineteen House.

admin-word-wordpress-tu-terminal-wp-cli

If you want to learn more about SSH terminals, take a look at this great section on dealing with file directories with SSH terminals on the server.

Install the Plugin via WP-CLI

Installing the plugin via the WordPress command line is almost instant because there is no time wasted when clicking the button. Also, you don't even have to log in to the WordPress admin panel to install the plugin.

To install the plugin, type the following command.

admin-word-wordpress-tu-terminal-wp-cli

Note: Replace (the plugin name) with the plugin name that appears in the page URL. For example, to set up contact form 7, use contact-form-7, as shown:

admin-word-wordpress-tu-terminal-wp-cli

Try installing WooCommerce, the popular plugin. Start by typing:

admin-word-wordpress-tu-terminal-wp-cli

It only takes a few minutes to install the plugin.

Activate the plugin, use:

width-wordpress-tu-terminal-wp-cli

word-ly-wordpress-tu-terminal-wp-cli

WP-CLI has a unique command line interface that significantly improves the way you install, manage, update, and move your WordPress website from another hosting provider to SocialSEO.

Some basic WP-CLI commands

To start using WP-CLI, type wp, press Enter. The system will list supported commands for managing WordPress applications through WP-CLI.

For more details about the command, option, type:

word-ly-wordpress-tu-terminal-wp-cli

For example, for more details about the Plugin command, enter:

admin-word-wordpress-tu-terminal-wp-cli

word-ly-wordpress-tu-terminal-wp-cli

Update WordPress Core

Check your WordPress core version, just use the following command:

word-ly-wordpress-tu-terminal-wp-cli

That brings up the WordPress core version.

To update the core file, type:

word-ly-wordpress-tu-terminal-wp-cli

The core of the WordPress website will be updated to the latest version available on WordPress.org.

admin-word-wordpress-tu-terminal-wp-cli

Perform activities on WordPress network (Multi-site installation)

Bạn là đại lý web có nhiều khách hàng, WP-CLI là phương pháp nhanh nhất cập nhật toàn bộ website đa trang WordPress.

Để thực thi lệnh tại Multisite WordPress, bạn sẽ cần đề cập đến URL website ở mạng nhờ sử dụng khóa chuyển đổi url.

quan-ly-wordpress-tu-terminal-wp-cli

Để biết danh sách đầy đủ lệnh, hãy truy cập website chính thức WP-CLI.

Conclude

Hy vọng bạn sẽ không gặp vấn đề gì khi sử dụng WP-CLI thuận lợi làm website WordPress, hoàn chỉnh với giao diện, plugin.

About My name is Nguyen Manh Cuong. I was born in a poor village in Ba Vi district, HA NOI province - windy and sunny land. Currently. https://www.nguyendiep.com/. Mr Cuong.
Newer Posts Newer Posts Older Posts Older Posts

Comments

Post a Comment