Skip to content

Instantly share code, notes, and snippets.

@Soben
Created October 2, 2018 21:33
Show Gist options
  • Save Soben/23b3d44635cb8d048eabcde00e9447f7 to your computer and use it in GitHub Desktop.
Save Soben/23b3d44635cb8d048eabcde00e9447f7 to your computer and use it in GitHub Desktop.
WP CLI search and replace on non-standard characters

We had a client that was seeing special characters on their website in Chrome and Internet Explorer on Windows.

It was an instance of the typical "hey we don't have an available character for this, so show the diamond with a question mark in it or a rectangle"

As this was a Wordpress site, we were able to use the WP CLI to resolve, but this should help others in a similar find/replace direction.

In this case the special character was \03 ... the code that shows up at the end of a copied string (https://cl.ly/8d8b44f8db54)

wp search-replace "$(printf \\03)" "" --dry-run --all-tables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment