How to use wp-cli to better manage word press sites

The command-line interface has always been popular in the developer world because it provides higher efficiency and speed when developing sites. Wp-cli helps web developers overcome the most difficult tasks when developing WordPress websites. This article describes how to set up wp-cli and use various commands to develop a faster and more efficient website. Just go! Before you go to the several pre step tutorials, make sure that you have successfully installed the command line interface for advanced word press management. The
To access SSH, you must first ensure that most managed services do not provide SSH access by default, so you have SSH (secure shell) access to managed services. If you do not have access rights, please seek help from the customer service center hosting the service. After disabling SSH access from the list of updated software, I want to ensure that WordPress 3.4 (or higher), PHP 5.3.2 (or higher), and UNIX like environments are enabled. For Windows users, command-line tools such as cygwin or virtual machine settings are required. All the resources required to run wp-cli can be installed on the word press website. The
Wp-cli installation wp-cli installation is very simple. As long as you the PHP file and save it anywhere on the drive, you can run it anywhere. This should be the primary goal when setting up the command line interface. First, to use the latest version, you must the wp-cli script from the GitHub Repository After ing the phar file, you must create it as an executable. To do this, execute the following command: Chmod +x WP cli The final step in phar installation is to move the newly created executable to a folder so that it can run anywhere. Another handy trick is to rename the executable to a name that is easy to remember. So the most common name is WP. If you change the file name, use the following command to save it to the WP folder on the drive: The
Sudo MV WP cli Phar\/usr\/local\/bin\/wp congratulations! Wp-cli has been successfully installed and you can now run wp-cli commands. To ensure that everything is in place, you can execute the following command: If WP info works well, you can see the following information displayed on the command line interface in the future: PHP binary: \/usr\/bin\/php
PHP version: 5.5.24
Php Ini used: \/etc\/php Ini
WP cli root dir: phar:\/\/wp-cli.phar
WP cli global config: \/users\/kouratoras\/ WP cli \/ config YML
WP cli project config:
Wp-cli version: 0.19.2 now wp-cli has been successfully installed. Let’s take a look at several commands that can be run and the operations to be performed. The
Start with basic wp-cli commands and operations. Word press can be easily installed using the core commands in wp-cli. This command provides a powerful tool set for managing word press installations. To install word press first, you must word press. Navigate to the directory where you want to WordPress CMS, and execute the following command: WP core this command the latest version of WordPress. After ing, use the core config command WP config: You can create PHP files. The
WP core config –dbname=databasename
Installing plug-ins is also an easy task. Wp-cli installs all plug-ins in the official word press plug-in repository. You can install the plug-in using the following command: Simply rename WP plugin install pluginname pluginname to the plug-in you want to install on the site. Activate pluginsto activate a plug-in, use the following command: WP plugin activate pluginname is just like this! The plug-in was installed on word press using wp-cli. To disable a plug-in to disable a plug-in, simply execute the following command: Just like updating the WP plugin deactivate pluginame plug-in, updating the plug-in is simple. Wp-cli has corresponding commands whether updating a single plug-in or updating all installed plug-ins. To update WP plugin update pluginname or all plug-ins, use the following simple command: WP plugin update – all this command helps to update all plug-ins currently in use within seconds. Post modification management word press stores all revisions of posts in the database. That is, the site’s database contains a lot of information that you do not need to use. Now it’s really a big problem. Unfortunately, wp-cli does not use simple commands to manage post revision. That is, wp-cli’s extended WP revisions cli plug-in helps with modified management. You can find this useful plug-in in the GitHub repository, and you can install it like a normal word press plug-in. When managing a WordPress site with bulk import images, other administrative problems usually occur when processing media or images. With wp-cli, there is no need to worry about media. Using the media tool in wp-cli, you can import all images and media to the site using the following command: WP media import images_folder\/* is much simpler than the normal administrator panel. Search and replace functionality the general approach most developers use is to build a site locally or on a development server, and then move the site to another server. In this process, copying and moving database files is simple and easy. The most difficult thing is that you need to replace the old URL in the database with the new URL. This is not difficult if you use wp-cli. The search and replace commands can easily replace the URL of a database entry. WP search replace’www.old-site Com”www.new-site Com \

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *