Skip to content

Instantly share code, notes, and snippets.

@ev3rywh3re
Created May 3, 2012 17:52
Show Gist options
  • Save ev3rywh3re/2587587 to your computer and use it in GitHub Desktop.
Save ev3rywh3re/2587587 to your computer and use it in GitHub Desktop.
WordPress: fix bad windows-latin garbage in database
update wp_posts
set post_content = replace(post_content,'’','\'');
update wp_posts
set post_content = replace(post_content,'…','...');
update wp_posts
set post_content = replace(post_content,'–','-');
update wp_posts
set post_content= replace(post_content,'“','"');
update wp_posts
set post_content= replace(post_content,'”','"');
update wp_posts
set post_content= replace(post_content,'‘','\'');
update wp_posts
set post_content= replace(post_content,'•','-');
update wp_posts
set post_content= replace(post_content,'–','-');
update wp_posts
set post_content= replace(post_content,'‡','c');
update wp_posts
set post_content= replace(post_content,'Â',' ');
update wp_posts
set post_content= replace(post_content,'',' ');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment