Skip to content

Instantly share code, notes, and snippets.

@verticalgrain
Last active August 9, 2017 23:02
Show Gist options
  • Save verticalgrain/522cbe85dc8c80a7c572305c398e4b7c to your computer and use it in GitHub Desktop.
Save verticalgrain/522cbe85dc8c80a7c572305c398e4b7c to your computer and use it in GitHub Desktop.
WP-Cli cheatsheet
// Search-replace - multisite
wp search-replace --network --url=site.company.com site.company.com site.company.dev --precise
// Import content to multisite
// Look up child site urls
wp site list --field=url
// Import content, skipping attachments to save time
wp import --url="http://site.dev/childsitename/" contentfile.xml --authors=create --skip=attachment
// Flush permalinks and rewrite htaccess
wp rewrite flush --hard
// Allow mod_rewrite to allow wp-cli to rewrite htaccess
apache_modules:
- mod_rewrite
// Change a user to being a super admin (access multisite network settings)
wp super-admin add admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment