softmaji-header-wbg-min
softmaji-header-wbg-min
softmaji-blue-header-min
softmaji-blue-header-min
  • Home
  • Services
    • Website Designing
      • Responsive Website Design
      • Static Website Design
      • Website Redesign
      • Landing Page Design
    • Website Development
      • PHP Website Development
      • WordPress Website Development
      • Ecommerce Website Development
      • Custom Website Development
    • Digital Marketing
      • Google Adwords/PPC
      • Facebook Promotion
    • SEO Service
  • Trainings
    • Learn Web Development
    • Learn Graphics Design
    • Learn Business Communication Skills
  • Pricing
  • Portfolio
  • Events
  • Offers
  • Contact Us

Learn to Install and Manage WordPress Sites With WP-CLI

HomeLearn to Install and Manage WordPress Sites With WP-CLI

Offer Expire Soon..


Only New User..


The below steps can be run with root privileges on a server (VPS hosting). This feature is preinstalled with our VPS hosting accounts.

In this tutorial, you will learn to install and manage WordPress with the WP-CLI. WP-CLI offers a command line interface for WordPress. Users get the tools necessary to install and update plugins, create databases without using a web browser.

Prerequisites

  • Unix-like environment (Linux, FreeBSD, Cygwin).
  • PHP 5.4 or later
  • WordPress 3.7 or later

Installation

Firstly, using SSH connect to your Server’s console. Then you can download the file wp-cli.phar using wget or curl.

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Then, check if the downloaded Phar file is working.

php wp-cli.phar --info

Then you will need to set the permission to make the Phar file executable using the below command:

chmod +x wp-cli.phar

Now, move the file wp-cli.phar to a new directory named wp under /usr/local/bin. With this, you will be able to execute the WP-CLI commands by typing ‘wp’ at the start.

sudo mv wp-cli.phar /usr/local/bin/wp

Run wp –info to check if the installation was successful. If it was successful, you’ll see the output below:

Table of Contents

Toggle
  • Steps to Manage WordPress with WP-CLI
  • Steps to Manage Themes
  • Steps to Manage Plugins
  • Steps to Update WordPress
  • Conclusion

Steps to Manage WordPress with WP-CLI

Let’s check some basic and useful WP-CLI commands.

WP-CLI Help System

WP-CLI offers a guide that is accessible by using “wp help“. This guide will give you a detailed info about a specific command. For example, if you want to learn in detail about config command, you can type in:

wp help config

Check the below sample output:

Steps to Manage Themes

Using the below command, list the themes present in your WordPress:

wp theme list

You will get the below output:

You can install a different theme, using the following command:

wp theme activate twentyseventeen

Steps to Manage Plugins

Similar to themes, you can also install and manage plugins using wp-cli.

Using the below command you can list the plugins that are already installed on your WP site.

wp plugins list

You can also search and install the plugins available from the command line. For example, use the command below to search for the plugin “Yoast SEO”.

wp plugin search yoast

You will get the below output:

Use the below command to install and activate the plugin:

wp plugin install wordpress-seo --activate

Steps to Update WordPress

To update WordPress from the command line, you will need to update the core WordPress files and the database to complete the update process.

Use the below command to update the WordPress core files:

wp core update

Then, use the below command to update the database:

wp core update-db

These are just the few commands that we have discussed in this guide. You will find more commands to manage your database, posts, and multi-sites.

Conclusion

Congratulations! Now you have learned to manage your WP installation from the command line.

Also Read:
The Complete Guide to Update Your WordPress

Delete Your WordPress Theme in 3 Successful Ways

Faizan Khan
18
Latest News
Prev PostLearn to Configure Redis for WordPressMay 14, 2024
Next PostSteps to Create a Custom WordPress 404 Error PageMay 14, 2024

Related items

Latest News

How To Install WordPress Blog?

Let’s see how to install WordPress blog on your WordPress hosting account. Let’s

Faizan Khan
14/05/2024
147
Latest News

How to Install a Theme in WordPress?

Steps to install a theme in WordPress: Log in to WordPress. Navigate to Appearance and cli

Faizan Khan
14/05/2024
132
Latest News

Fatal error: Allowed memory size of xxxx bytes exhausted (tried to allocate xx bytes)

WordPress is a free open source blogging tool. When posting a article OR uploading a image

Faizan Khan
14/05/2024
145
softmaji-header-wbg-min
SoftMaji is one of the affordable web development company in the web development industry. You don’t have to go searching anywhere for finding a reliable web development partner because we have crafted web development solutions that can fill the void left by others in the market.
Services
  • News Portal Development
  • Custom Website Development
  • PHP Website Development
  • Ecommerce Website Development
  • WordPress Website Development
Shortlinks
  • Blog
  • Offers
  • Events
  • Pricing
  • Reviews
  • Portfolio
  • Our Team
  • Payment Options
  • Explore Packages
Company
  • FAQ
  • Careers
  • Sitemap
  • Feedback
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions
  • Refund And Cancellation
Contact Us
4/40 Vipul Khand , Gomti Nagar Lucknow
Uttar Pradesh 226010
Landline - +915223162418
Email - hello@softmaji.in
Office Time Mon - Sat
(10:00AM - 5:00PM)
Sunday Close
+91 9795405324
Lucknow , Uttar Pradesh
Copyright © 2022. All Rights Reserved.