WP cli –path does not seem to work

It’s as if you were trying to run: wp plugin status –path=$(/home/me/domains/example.com/public_html) because what’s inside the backticks get’s evaluated. Here’s a good reading about using backticks in the command line. Let me quote @rozcietrzewiacz: Backtick is not a quotation sign, it has a very special meaning. Everything you type between backticks is evaluated (executed) by … Read more

wp-cli commands do nothing, return nothing

Try the –skip-plugins flag with the problematic commands. Just as you experienced I’ve had wp-cli error out silently and do nothing, while frustratingly work for the simpler commands version/info commands. My silent errors were due to a bad plugin. This plugin was using php short tags, which weren’t enabled in php/x.x/cli/php.ini which wp-cli uses.

How to use wp-cli.yml file?

TL;DR: Run wp version –debug Check that wp-cli.yml was found Check that the ABSPATH set by WP-CLI matches the directory where WP is installed Look at find_wp_root() for hints about why it’s finding the wrong folder The docs say: inside the current working directory (or upwards) …so you should be able to use it in … Read more

WP-CLI Process Killed

Which version of WP-CLI are you using? What is wp –version returning you? Seems a little bit that you may be running out of memory as this is quite a large amount of images and there doesn’t seem some proper batch processing implemented in version 1 of WP-CLI. At least, that’s how I’d understand this … Read more

WordPress test environment on windows

Your best bet to set up a reusable test environment on a Windows machine is to use Vagrant with a setup such as this. Vagrant will allow you to build portable, reusable virtual machines with a very simple interface which you can use across different operating systems and team members. To set it up, you … Read more

Changing the WP CLI cache folder

You could try to change it through the environment variable: WP_CLI_CACHE_DIR as we have it included in the WP_CLI::get_cache() method (src): $dir = getenv( ‘WP_CLI_CACHE_DIR’ ) ? : “$home/.wp-cli/cache”; You can also check out issue #1848 – Use shared cache directory for multiple installs for usage examples. In the WP-CLI Handbook on make.wordpress.org, we have … Read more

WP-CLI Cannot Connect to Database due to Vagrant

Since the issue is probably DB configuration you could try adjusting it conditionally in wp-config.php: if ( defined( ‘WP_CLI’ ) ) { define( ‘DB_HOST’, ‘example.com’ ); } else { define( ‘DB_HOST’, ‘localhost’ ); }

How can I batch delete all unattached images with WP-CLI or other automated process?

You can try this (untested) modification to the answer you linked to by @something wp post delete $(wp post list –post_type=”attachment” –format=ids –post_parent=0) to delete attachments without parents. To target a given mime type, e.g. image/jpeg try: wp post delete $(wp post list –post_type=”attachment” \ –format=ids –post_parent=0 –post_mime_type=”image/jpeg”) Notes: Remember to backup first before testing! … Read more

How to change user_login with wp-cli?

Not allowed by design: If we try to change the user login by the email: wp user update [email protected] –user_login=mary_new or by the user id: wp user update 123 –user_login=mary_new we get the following warning: User logins can’t be changed. This is the reason: if ( isset( $assoc_args[‘user_login’] ) ) { WP_CLI::warning( “User logins can’t … Read more

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