Skip to content

Instantly share code, notes, and snippets.

@gjreasoner
Last active March 23, 2018 03:16
Show Gist options
  • Save gjreasoner/813c48f4c917634d0fda5e38f09ef2bb to your computer and use it in GitHub Desktop.
Save gjreasoner/813c48f4c917634d0fda5e38f09ef2bb to your computer and use it in GitHub Desktop.
Quick WordPress setup
#!/bin/bash
## Usage: wp-create [site-name]
SITENAME=$1
cd ~/git/;
mkdir $SITENAME
cd ~/git/$SITENAME;
wp core download
mysql -u root -e "create database $SITENAME"
wp config create --dbname="$SITENAME" --dbuser=root
wp core install --url="$SITENAME.test" --title="$SITENAME" --admin_user=root --admin_password=password --admin_email=placeholder@z.com
# Install WP Pusher (example plugin)
wget https://dashboard.wppusher.com/download/latest
mv latest wp-content/plugins
cd wp-content/plugins
unzip latest
cd ../../
wp plugin activate wppusher
# Remove themes
rm -rf wp-content/themes/twentyfifteen
rm -rf wp-content/themes/twentysixteen
# Lock down file changes
wp config set DISALLOW_FILE_MODS true --raw --type=constant
# Ready to deploy?
# wp search-replace 'example.dev' 'example.com' --skip-columns=guid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment