How to change a post attribute to homepage using WP CLI?

To set the site’s static home page with WP-CLI, you should be able to do something like this: wp option update show_on_front “page” wp option update page_on_front {$page_id} … where {$page_id} is the ID of the page you want to be the front page. (Your question was originally tagged multisite—if you’re running a Multisite installation, … Read more

Ask WP-CLI latest core WordPress version released

wp core version displays your current WordPress version. $ wp core version 5.2.4 Adding –extra shows extended version information. $ wp core version –extra WordPress version: 5.2.4 Database revision: 44719 TinyMCE version: 4.940 (4940-20190515) Package language: en_US wp core check-update lists the most recent versions when there are updates available, or success message when up … Read more

Get WP CLI to hide debug warnings and notices in JSON output, same setting as website

A quick manual solution is to direct all error output to a log file somewhere or even to /dev/null. With your command this would look like this: wp plugin list –fields=name,status,update,version,update_version,title –format=json 2> ./cli-command.err.log If you totally don’t care about the errors, warnings and notices, you could send it to /dev/null like this: wp plugin … Read more

Setting boolean and array values using wp theme mod set

Funny how you find the answer just after posting a question. Posting here, in case someone comes looking for it. As per @Kero’s comment above, that’s correct. The command-line option will only recognise strings. There is however an eval-file command that can be used to achieve this (and now that I have discovered it, a … Read more

How to perform WordPress backups using wp-cli?

You can use the WP-CLI command wp db export <filename> Run the command from within the home directory for the install. Now, you have a database included in your files. Zip up the directory and move it aside. Now you can perform the upgrade, and if something breaks, replace with the old site and import … Read more

Execute wp-cli command on all sites on server

Here’s an example using find with a directory type and zero maxdepth: $ find /srv/users/serverpilot/apps/*/public/ \ -type d \ -maxdepth 0 \ -exec /usr/local/bin/wp core update –path={} \; or in a single line: $ find /srv/users/serverpilot/apps/*/public/ -type d -maxdepth 0 -exec /usr/local/bin/wp core update –path={} \;

WP-CLI alias: connect with ssh proxy

I created simillar configuration to yours and proxy is working for me. My config looks like: Host production HostName xxx.xxx.xxx.xxx ProxyCommand ssh -q -W %h:22 vagrant ForwardAgent yes Host vagrant HostName 127.0.0.1 User vagrant Port 2222 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /path/to/.vagrant/machines/default/virtualbox/private_key IdentitiesOnly yes ForwardAgent yes LogLevel FATAL I’m treating my vagrant local … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)