Skip to content

Instantly share code, notes, and snippets.

@Lovor01
Created July 8, 2023 09:11
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 Lovor01/0216fb4ad7e4b009bc2ee5f7166ce45a to your computer and use it in GitHub Desktop.
Save Lovor01/0216fb4ad7e4b009bc2ee5f7166ce45a to your computer and use it in GitHub Desktop.
WP CLI search replace regex

Use regex to replace (windows, powershell)

wp search-replace '(<!-- wp:image\s{[^}]*)' '$1,"sizeSlug":"full"' wp_posts --regex --regex-delimiter='/' --dry-run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment