brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: wp cli check-update tells you when the WP-CLI behind your WordPress is old

WordPress
~/tips/tip-wordpress-cli-check-update

wp cli check-update

Checks for a newer WP-CLI release and updates the phar after you confirm.

It is easy to keep WordPress and plugins up to date and forget the tool that does it. WP-CLI can check on itself.

wp cli check-update
wp cli update

The first command says Success: WP-CLI is at the latest version. or shows a table with the newer version, its type (patch, minor or major) and the download URL. The second one downloads it and asks for a y before it replaces your copy. --yes skips the question for scripts.

A new major version is held back on purpose. You get a message telling you to run wp cli update --major if you want to cross that line. I think that is reasonable, because a major version can drop support for an old PHP version or change a command. --patch and --minor limit the check to smaller steps.

wp cli version prints what you run now. If you installed WP-CLI as /usr/local/bin/wp, the update has to write to that file, so it may need sudo. And if it came from a package manager like Homebrew or a Docker image, update it through that instead. Otherwise the package manager and the file on disk disagree about what you have.

Further reading: wp cli check-update, wp cli update

More WordPress tips wp user application-password create anna backup-script --porcelain define( 'MEDIA_TRASH', true ); wp theme delete --all wp media image-size wp server --host=127.0.0.1 --port=8080 All WordPress tips (85) All topics

Link