Delete smart quotes and fix latin1>utf8 encoding issues in WordPress

If you use wptexturize, smart quotes will mess you up. This is a quick and dirty fix.

UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,""","'");
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,"“",'"');
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,"",'"');
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,"‘","'");
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,"","'");
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,"ö","ö");
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,"ü","ü");
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,"é","é");
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,"É","É");
 
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,"é","é");
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,""","'");
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,"",'"');
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,"”",'"');
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,"","'");
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,"’","'");
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,"ö","ö");
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,"ü","ü");
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,"é","é");
 
 
UPDATE wordpress.wp_posts SET post_title = REPLACE(post_title,""","'");
UPDATE wordpress.wp_posts SET post_title = REPLACE(post_title,"“",'"');
UPDATE wordpress.wp_posts SET post_title = REPLACE(post_title,"”",'"');
UPDATE wordpress.wp_posts SET post_title = REPLACE(post_title,"‘","'");
UPDATE wordpress.wp_posts SET post_title = REPLACE(post_title,"’","'");
 
UPDATE wordpress.wp_posts SET post_title = REPLACE(post_title,"ö","ö");
UPDATE wordpress.wp_posts SET post_title = REPLACE(post_title,"ü","ü");
UPDATE wordpress.wp_posts SET post_title = REPLACE(post_title,"é","é");

Leave a Reply