Skip to content

Instantly share code, notes, and snippets.

@chuckreynolds
Created February 28, 2013 09:36
Show Gist options
  • Save chuckreynolds/5055517 to your computer and use it in GitHub Desktop.
Save chuckreynolds/5055517 to your computer and use it in GitHub Desktop.
SQL Statement Replace Smart Curly Quotes with Regular Quotes in WordPress. I was migrating an old wp site with a ton of content I noticed a lot of curly quotes / smart quotes and the curly single quotes. My OCD hates that and it's not proper and looks bad to bots so I wanted to batch change them all to regular ascii quotes. This statement handle…
UPDATE wp_posts SET post_content = replace(replace(replace(post_content, '“', '"'), '”', '"'), '’', '''');
@earthbound19
Copy link

Thanks. It actually kinda grieves me to make use of this; "correct" typography uses curly quotes, but in my case a self-hosted search engine chokes on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment