How to Install WordPress and Essential Plugins Using WP-CLI

Setting up a WordPress site can be time-consuming if done manually, but with WP-CLI, the process becomes much faster and more efficient. In this tutorial, I’ll show you how to install WordPress along with a few essential plugins using a single command …


This content originally appeared on DEV Community and was authored by Md Aminur Islam

Setting up a WordPress site can be time-consuming if done manually, but with WP-CLI, the process becomes much faster and more efficient. In this tutorial, I'll show you how to install WordPress along with a few essential plugins using a single command sequence.

Step 1: Download WordPress Core

First, you'll need to download the WordPress core files. This command will download WordPress to a directory called mywebsite.

wp core download --path=mywebsite

Step 2: Create the Configuration File

Navigate into the newly created mywebsite directory, and create the wp-config.php file with your database credentials:

cd mywebsite
wp config create --dbname=silk --dbuser=root --dbpass=root

Step 3: Create the Database

Now, create the database using the following command:

wp db create

Step 4: Install WordPress

Install WordPress using your local URL, site title, and admin credentials:

wp core install --url=mywebsite.test --title="Site Title" --admin_user=admin --admin_password=admin --admin_email=mywebsite@welabs.dev

Step 5: Install and Activate Plugins

Finally, install and activate the necessary plugins. In this example, we'll install WooCommerce and Dokan Lite:

wp plugin install woocommerce --activate
wp plugin install dokan-lite --activate

All-in-One Command Sequence

For your convenience, here’s the entire process in one continuous block of code. Just copy and paste the code below into your terminal to install WordPress and a few plugins with a single command.

wp core download --path=mywebsite
cd mywebsite
wp config create --dbname=silk --dbuser=root --dbpass=root
wp db create
wp core install --url=mywebsite.test --title="Site Title" --admin_user=admin --admin_password=admin --admin_email=mywebsite@welabs.dev
wp plugin install woocommerce --activate
wp plugin install dokan-lite --activate

Prerequisite: Install WP-CLI to you machine.


This content originally appeared on DEV Community and was authored by Md Aminur Islam


Print Share Comment Cite Upload Translate Updates
APA

Md Aminur Islam | Sciencx (2024-08-10T12:41:39+00:00) How to Install WordPress and Essential Plugins Using WP-CLI. Retrieved from https://www.scien.cx/2024/08/10/how-to-install-wordpress-and-essential-plugins-using-wp-cli/

MLA
" » How to Install WordPress and Essential Plugins Using WP-CLI." Md Aminur Islam | Sciencx - Saturday August 10, 2024, https://www.scien.cx/2024/08/10/how-to-install-wordpress-and-essential-plugins-using-wp-cli/
HARVARD
Md Aminur Islam | Sciencx Saturday August 10, 2024 » How to Install WordPress and Essential Plugins Using WP-CLI., viewed ,<https://www.scien.cx/2024/08/10/how-to-install-wordpress-and-essential-plugins-using-wp-cli/>
VANCOUVER
Md Aminur Islam | Sciencx - » How to Install WordPress and Essential Plugins Using WP-CLI. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/10/how-to-install-wordpress-and-essential-plugins-using-wp-cli/
CHICAGO
" » How to Install WordPress and Essential Plugins Using WP-CLI." Md Aminur Islam | Sciencx - Accessed . https://www.scien.cx/2024/08/10/how-to-install-wordpress-and-essential-plugins-using-wp-cli/
IEEE
" » How to Install WordPress and Essential Plugins Using WP-CLI." Md Aminur Islam | Sciencx [Online]. Available: https://www.scien.cx/2024/08/10/how-to-install-wordpress-and-essential-plugins-using-wp-cli/. [Accessed: ]
rf:citation
» How to Install WordPress and Essential Plugins Using WP-CLI | Md Aminur Islam | Sciencx | https://www.scien.cx/2024/08/10/how-to-install-wordpress-and-essential-plugins-using-wp-cli/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.