Skip to content

Instantly share code, notes, and snippets.

@gormus
Created June 25, 2020 06:13
Show Gist options
  • Save gormus/bb9ef6f608b3110ae6fa21002cacc6b7 to your computer and use it in GitHub Desktop.
Save gormus/bb9ef6f608b3110ae6fa21002cacc6b7 to your computer and use it in GitHub Desktop.
WP CLI search-replace normalize syntax highlighting wrapper markup
#!/usr/bin/env bash
wp search-replace '<pre[^>]*>(<code[^>]*>)*' '<pre><code>' 'wp_posts' \
--regex \
--regex-flags='i' \
--skip-plugins \
--skip-themes \
--skip-packages \
--color \
--include-columns='post_content' \
--dry-run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment