WP-CLI Get Site ID from its url

It looks like –url isn’t working to filter the wp site list output. So instead one could try: wp site list | awk ‘{ if( $2 == SITE_URL_STRING ) print $1; }’ where we use the awk trick from here, to filter the url column and display the blog_id column. Here we must replace SITE_URL_STRING … Read more

wp-cli silently fails with 255 when running wp core install

I was missing some php extensions that wp-cli and/or WordPress needed but there is no error output stating as much. I’m guessing it was specifically the missing mysqli extension. I used a WP-CLI command to test the base container for missing extensions and now I have sudo docker-php-ext-install gd sockets mysqli exif in my config.yml. … Read more

How to run nested xargs commands?

xargs is unnecessary, something similar to this will do the job without any piping or xargs: sites=$(wp site list –field=url) for site in $sites do users=$(wp user list –url=”$site” –role=subscriber) for user in $users do wp user delete $user –url=”$site” –reassign=4 end end

how do you use Wp-cli on Shared Hosting? [closed]

the default instructions assume you have root and are intended to provide the most convenient use by placing the phar package in your path alternative 1: remove the sudo, change /usr/local/bin/wp to /path/to/your/installation/wp, and instead of calling the commands with wp command <parameters> use ./wp command <parameters> alternative 2: remove the sude, change /usr/local/bin/wp to … Read more

What tools respect `.distignore`?

This is file for WP CLI. the command dist-archive: wp dist-archive . Note that you need to install both WP CLI and this plugin: wp package install wp-cli/dist-archive-command

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