wp post list --post_type=<cpt-name> --field=ID | xargs -I % wp post meta update % _yoast_wpseo_meta-robots-nofollow 1
wp site list --field=url | xargs -I % bash -c "echo 'URL:' % && wp theme list --url=% --status=active"
wp site list --field=url | xargs -I % bash -c "echo 'URL:' % && wp term delete category <category-slug> --by=slug --url=%"
wp site list --field=url | xargs -I % bash -c "echo 'URL:' % && wp option update test_key test_value --url=%"
wp site list --field=url | xargs -I % bash -c "echo 'URL:' % && wp rewrite flush --url=%"
wp post list --field=ID --post_type=post --post_status=publish | xargs -I % wp post update % --post_status=publish
wp taxonomy list --fields=name | xargs -I % wp post term list <Post ID> %
wp taxonomy list --field=name | xargs wp term recount
wp post list --post_type=post --fields=ID | xargs -I % wp post term set % category "daily-briefing"
wp post list --field=ID --category=<category slug> | xargs -I % bash -c "wp post term add % <taxonomy> <term slug> --by=slug && wp post term remove % <taxonomy> <term slug>"
wp post list --field=ID | xargs -I % bash -c "wp post meta update % <meta field> $(wp post get % --field=post_parent)"
for postID in $(wp post list --post_type=sfwd-topic --field=ID); do wp post meta update "$postID" sort_date '$(wp post get "$postID" --field=post_date_gmt)'; echo "$postID"; done;
wp post list --field=ID --meta_key=<meta key> '--meta_compare=NOT EXISTS' | xargs -I % wp example transform run --post_id=%
wp db export --single-transaction
wp site list --field=url | xargs -I % wp user set-role <user ID> <role> --url=%
for postID in $(wp post list --post_type=page --field=ID); do wp post meta update $postID sort_date "$(wp post get $postID --field=post_date)"; echo "$postID"; done;
for url in $(wp site list --field=url --archived=0 --deleted=0 --public=1); do echo "Indexing site: $url" && wp elasticpress sync --per-page=100 --url=$url --force --quiet --yes; done
for url in $(wp site list --field=url --archived=0 --deleted=0 --public=1); do echo "Indexing site: $url"; yes "y" | wp elasticpress sync --per-page=100 --url=$url --force --quiet --yes; done
wp db export --all-tablespaces --single-transaction --quick --lock-tables=false - | gzip -9 - > wordpress-dump.sql.gz
WP_CLI_PATH="./wp-cli.phar" && WP_ROOT_PATH="./wp/." && for url in $(${WP_CLI_PATH} site list --path="${WP_ROOT_PATH}" --field=url 2>/dev/null); do bash -c "${WP_CLI_PATH} option get siteurl --path="${WP_ROOT_PATH}" --url="${url}" 2>/dev/null"; done;
WP_CLI_PATH="./wp-cli.phar" && \
WP_ROOT_PATH="./wp/." && \
for url in $(${WP_CLI_PATH} site list --path="${WP_ROOT_PATH}" --field=url 2>/dev/null); do bash -c "${WP_CLI_PATH} option get siteurl --path="${WP_ROOT_PATH}" --url="${url}" 2>/dev/null"; done;
WP_CLI_PATH="./wp-cli.phar" && WP_ROOT_PATH="./wp/." && for url in $(${WP_CLI_PATH} site list --path="${WP_ROOT_PATH}" --field=url 2>/dev/null); do bash -c "${WP_CLI_PATH} elasticpress sync --quiet --per-page=50 --path="${WP_ROOT_PATH}" --url="${url}" 2>/dev/null"; done;
./wp-cli.phar --path=./wp/. user create <username> <email> --user_pass=<password> --role=administrator --porcelain | xargs -I {} bash -c "./wp-cli.phar --path=./wp/. super-admin add {}"
wp plugin list | \
awk 'BEGIN{N=0;} \
($3=="available"){N++; print $0;} \
END{print(N>0)?"Plugin updates available: "N:"No plugin updates available";}'
wp site list --field=url | xargs -I % bash -c "echo 'URL:' % && wp rewrite flush --url=% && wp cache flush --url=% && wp transient delete --all --url=% && wp beaver clearcache --url=%"