Skip to content

Instantly share code, notes, and snippets.

@josephfusco josephfusco/

Last active Jan 18, 2018
What would you like to do?
# Create folder for site.
mkdir $sites_directory/$1 && cd $sites_directory/$1
# Download WordPress & setup database
wp core download
wp core config --dbname="${db_prefix}${1}" --dbuser=root --dbhost=
wp db create
wp core install --url="$1".test --title="$1" --admin_user="$admin_username" --admin_password="$admin_password" --admin_email="$admin_email" --skip-email
# Remove plugins.
wp plugin delete hello
wp plugin delete akismet
# Install plugins.
wp plugin install wordpress-importer --activate
wp plugin install contact-form-7
wp plugin install advanced-custom-fields --activate
wp plugin install --activate
wp plugin install --activate
wp plugin install --activate
# Download & activate theme.
wp theme install checathlon --activate
# Import theme unit test data.
wp import ~/test-data/wptest.xml --authors=create # Downloaded from
# Remove menus from wptest.xml import
wp menu delete empty-menu
wp menu delete long-menu
wp menu delete testing-menu
# Create our own test menu.
wp menu create my-test-menu
wp menu location assign my-test-menu primary
wp menu item add-post my-test-menu 919 # Based off wptest.xml data.
wp menu item add-post my-test-menu 1086 # Based off wptest.xml data.
wp menu item add-custom my-test-menu '💣 Self Destruct' http://${1}.dev/wp-admin/tools.php?page=self-destruct
# Discourage search engines.
wp option update blog_public 0
# Set pretty permalinks.
wp rewrite structure '/%postname%/' --hard
wp rewrite flush --hard
# Open newly created site in browser.
open http://${1}.test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.