Skip to content

Instantly share code, notes, and snippets.

@monkeymonk
Created January 14, 2022 17:50
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 monkeymonk/18cc3756805a255b0103ad49c113ad2f to your computer and use it in GitHub Desktop.
Save monkeymonk/18cc3756805a255b0103ad49c113ad2f to your computer and use it in GitHub Desktop.
WP-CLI Usefull commands
  • wp rewrite flush - Flush rewrite rules
  • wp media image-size - List registered image sizes
  • wp media regenerate --yes - Regenerate all media
  • wp search-replace https://old.domain.tld https://new.domain.tld - Replace an old domain in database
  • wp db export --add-drop-table - Backup database
  • wp db import backup.sql - Import backup in database
  • wp maintenance-mode activate - Maintenance mode (use wp maintenance-mode deactivate to return to normal)
  • wp rewrite list - Show rootes list
  • wp search-replace "old_post_type" "new_post_type" wp_posts --include-columns="guid,post_type" - Rename post_type (use --dry-run to check what it will do)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment