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
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/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.