Type and run, automate
Jaime Martínez | @jmslbam | #WC024 | 1 sept 2018
wp core update
wp core update-db
wp db import
wp search-replace http://nu.nl http://nu.test
wp user update 1 --user_pass=test
wp rewrite flush
wp option set blogname
wp media regenerate
wp transient delete-expired
Output just the new post id.
wp media import ~/Pictures/jaimemartinez.png --post_id=$(wp post create --post_name=wpmeetup --post_title='Profile picture of Jaime' --porcelain)
wp post update $(wp post list --post_type='zombie' --format=ids) --post_status=publish
wp post list --post_type='zombie' --format=ids
wp post update 33 45 68 --post_status=publish
wp media regenerate $(wp post list --post_type=attachment --format=ids --posts_per_page=50)
#!/bin/bash #
for url in $(wp site list --fields=url --format=csv | tail -n +2)
do
wp --url=$url core update-db
done
cat plugins.txt | xargs wp plugin install
advanced-custom-fields
https://github.com/Jeradin/acf-website-field/archive/master.zip
wordpress-seo
wp core multisite-install --url="http://www.hbo.com" --base="http://www.hbo.com" --title="HBO network" --admin_user=gaya --admin_password=wadup --admin_email="yo@dawg.com"
# For each line add a new site within the multisite installation
while read show ;
# Creating multisite {$show}.the-world.com
wp site create --slug=$show --title=$show --email=yo@dawg.com
done < shows.txt
wp plugin deactivate my-broken-plugin --skip-plugins=my-broken-plugin
wp custom-command --skip-plugins
/**
* @synopsis --handshake[=<secret>] [--a=<b>]
*/
[--handshake[=<secret>]]
wp post delete 1 3 4 5 66 798