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: the --url flag points wp-cli at one wordpress site of a multisite network

WordPress
~/tips/tip-wordpress-wp-cli-url-flag-multisite

wp plugin list --status=active --url=https://shop.example.com

Selects which site of a multisite network a WP-CLI command should run on.

On multisite every WP-CLI command runs against the main site unless you say otherwise.

wp plugin list --status=active --url=https://shop.example.com
wp option get blogname --url=https://shop.example.com

--url is a global parameter that tells WP-CLI which site to load, so options, users and plugin status are read from that site. Without it you may think a plugin is inactive when it is only inactive on the main site. The flag also helps on a single site when the home address cannot be detected, for example in a cron job without a web server context.

Further reading: WP-CLI commands and global parameters

More WordPress tips wp user application-password create anna backup-script --porcelain define( 'MEDIA_TRASH', true ); wp cli check-update wp theme delete --all wp media image-size All WordPress tips (85) All topics

Link