Created
February 15, 2014 21:59
-
-
Save wpsmith/9025732 to your computer and use it in GitHub Desktop.
SQL: Remove strange characters from posts and comments.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_comments SET comment_content = REPLACE(comment_content, '“', '“'); | |
UPDATE wp_comments SET comment_content = REPLACE(comment_content, 'â€', '”'); | |
UPDATE wp_comments SET comment_content = REPLACE(comment_content, '’', '’'); | |
UPDATE wp_comments SET comment_content = REPLACE(comment_content, '‘', '‘'); | |
UPDATE wp_comments SET comment_content = REPLACE(comment_content, '—', '–'); | |
UPDATE wp_comments SET comment_content = REPLACE(comment_content, '–', '—'); | |
UPDATE wp_comments SET comment_content = REPLACE(comment_content, '•', '-'); | |
UPDATE wp_comments SET comment_content = REPLACE(comment_content, '…', '…'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment