Rate this article :
5/5 | 2 opinion
This article was useful to you ?
Yes
No
Vous avez noté 0 étoile(s)
Sommaire
Procédure
WP-CLI is a command line tool that allows you to administer your WordPress installations from the command line console. WP-CLI allows you to access WordPress functionalities without necessarily using a web browser and without connecting to your site's administrator space.
It is no longer necessary to install WP-CLI on cPanel, as it is now pre-installed and available by default on all our shared cPanel and CloudCP packages. To test WP-CLI, you can use the following command from the terminal of your cPanel web hosting package:
wp --info
You should then have information relating to your web hosting environment, such as the PHP version active on your console and the version of WP-CLI :
1. Go to the "public_html" or"www" directory
cd public_html
2. Download WordPress :
wp core download
3. Create your database and username via your cPanel interface
4. Modify the configuration file for your WordPress site
wp core config --dbname="dbuser_name" --dbuser="dbuser" --dbprefix="wp_" --dbpass="password
If you reload your web page, you should arrive on a page explaining that you already have a"wp-config" configuration file installed.
5. Startinstalling WordPress.
wp core install --url="http://mondomaine.com"--title="My WordPress site" --admin_user="Franck" --admin_password="password" --admin_email="contact@mondomaine.com"
6. When you install Wordpress with WP-CLI, the default language is English. To change the language and put WordPress in French, type the following commands to install and activate the French language:
wp core language list wp core language install --activate fr_FR
1. To view the list of themes installed on WordPress, type the following command:
wp theme list
2. Toinstall a new Wordpress theme, go to the Wordpress site and choose the theme. Once the theme has been chosen, copy the theme name from the URL.
3. Type the following command in SSH:
wp theme install theme_name
theme_name must be replaced by the name of the theme you have chosen.
4. Activate the theme with the following command line:
wp theme activate theme_name
1. List the existing extensions on your WordPress site.
wp plugin list
2. Install the extension you want. The principle is the same as for installing a theme. Choose the name of the plugin on the Wordpress site and type the installation command in SSH, not forgetting to change"my_plugin" to the name of the desired extension.
wp plugin install my_plugin
3. Now activate the module you have installed.
wp plugin activate my_plugin
Thanks to WP-CLI, you can deactivate a WordPress extension without accessing the administration interface. This is certainly useful if you have lost access to your administration following the installation of a plugin (such as a security plugin).
To deactivate a plugin, use the following command:
wp plugin deactivate my_plugin
WordPress stores temporary information such as user preferences in the MySQL wp_options table in the form of transients. If this table is too large, your site will be slow to search for information. Fortunately, WordPress indicates the expiry date of a transient, which means that after this date, WordPress no longer needs it. You can then delete them to reduce the size of wp_options with the following command:
wp transient delete-expired
You can also delete all transients, regardless of their expiry date, with the following command:
wp transient delete-all
If your website has been or is infected, it is possible that WordPress files or plugin and theme files have been altered by viruses so that they can embed themselves. The following command can be used to automatically check WordPress files for possible corruption, and even identify files that should not exist in the wp-admin or wp-includes folder.
wp core verify-checksums
You can use the following command to do the same for plugins:
wp plugin verify-checksums --all
If you have corrupted files, you can remedy this problem by replacing the corrupted files with the original files available on www.wordpress.org in your FTP space.
You are now able to use SSH command lines and WP-CLI to install your Wordpress website, theme and modules.
Don't hesitate to share your comments or questions!
Rate this article :
5/5 | 2 opinion
This article was useful to you ?
Yes
No
1mn reading
How do I program a Cron task in cPanel?
0mn reading
How do I connect to cpanel via SSH using putty?
1mn reading
How do I resolve the ERR_CONNECTION_REFUSED error on cPanel?
2mn reading
How do I create cPanel hosting sub-accounts?