Skip to content

Instantly share code, notes, and snippets.

@yusufhm
Last active September 10, 2020 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yusufhm/984c819eaeadf43678f5f8be280ca964 to your computer and use it in GitHub Desktop.
Save yusufhm/984c819eaeadf43678f5f8be280ca964 to your computer and use it in GitHub Desktop.
wp-cli commands
#!/usr/bin/env bash
# Create an admin user.
wp user create username user@example.com --role=administrator
# Reset user password.
wp user update user --user_pass=password --skip-email
# Create a database backup.
wp db export - | gzip -9 > db.sql.gz
# Drop the database.
wp db drop
# Re-create the database.
wp db create
# Load a database.
gunzip -c db.sql.gz | wp db query
# Update site url.
wp option update home 'http://my-new.url'
wp option update siteurl 'http://my-new.url'
# Flush cache
wp cache flush
# Delete all transients.
wp transient delete --all
# Run Quttera internal scan.
wp cron event run qtr_internal_scan_cron_hook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment