![]() |
https://github.com/wp-cli/wp-cli/
https://wp-cli.org/
A program for various WordPress functions, so you can script/automate or just do things at the commandline.
An essential time-saver.
–
- 2025-01-01 – 2.11.0
-
2017-11-27 – (version not recorded) – notes not taken
Table of Contents [hide]
2025-01-01 – 2.11.0 ∞
PHP 8.3.14 (cli) (built: Nov 21 2024 10:27:49) (NTS) Copyright (c) The PHP Group Zend Engine v4.3.14, Copyright (c) Zend Technologies
Usage ∞
Various ideas:
wp-cli maintenance-mode activate wp-cli maintenance-mode deactivate
Force all WordPress users to log out ∞
The easiest way is to shuffle the salts specified in wp-config.php, which is trivial to do for the set of variables with:
wp-cli config shuffle-salts
Using wp-cli to change a blog’s “Site URL” ∞
I needed this to avoid the WordPress “White Screen of Death” (WSOD)
website='http://example.com' wp-cli option update home "$website" wp-cli option update siteurl "$website"
Installation ∞
Make sure you have the PHP Extensions and Applications Package pearweb_phars (PHAR) installed on your server.
wget https://github.com/wp-cli/wp-cli/releases/download/v2.11.0/wp-cli-2.11.0.phar # \curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar chmod +x wp-cli-2.11.0.phar # I recommend: ln -s wp-cli-2.11.0.phar wp
Then you can run it directly while you in a WordPress installation’s main directory; that’s the directory which has wp-config.php
Alternatives ∞
-
The GUI. :/

