-
-
Save johndiego/a6e5f077e863752c63aed5ae6f07fb48 to your computer and use it in GitHub Desktop.
Remove funky characters in WordPress database
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_title = replace(post_title,'’','\''); | |
update wp_comments set comment_content = replace(comment_content,'’','\''); | |
update wp_postmeta set meta_value = replace(meta_value,'’','\''); | |
update wp_posts set post_content = replace(post_content,'…','...'); | |
update wp_posts set post_title = replace(post_title,'…','...'); | |
update wp_comments set comment_content = replace(comment_content,'…','...'); | |
update wp_postmeta set meta_value = replace(meta_value,'…','...'); | |
update wp_posts set post_content = replace(post_content,'–','-'); | |
update wp_posts set post_title = replace(post_title,'–','-'); | |
update wp_comments set comment_content = replace(comment_content,'–','-'); | |
update wp_postmeta set meta_value = replace(meta_value,'–','-'); | |
update wp_posts set post_content = replace(post_content,'“','"'); | |
update wp_posts set post_title = replace(post_title,'“','"'); | |
update wp_comments set comment_content = replace(comment_content,'“','"'); | |
update wp_postmeta set meta_value = replace(meta_value,'“','"'); | |
update wp_posts set post_content = replace(post_content,'‘','\''); | |
update wp_posts set post_title = replace(post_title,'‘','\''); | |
update wp_comments set comment_content = replace(comment_content,'‘','\''); | |
update wp_postmeta set meta_value = replace(meta_value,'‘','\''); | |
update wp_posts set post_content = replace(post_content,'•','-'); | |
update wp_posts set post_title = replace(post_title,'•','-'); | |
update wp_comments set comment_content = replace(comment_content,'•','-'); | |
update wp_postmeta set meta_value = replace(meta_value,'•','-'); | |
update wp_posts set post_content = replace(post_content,'‡','c'); | |
update wp_posts set post_title = replace(post_title,'‡','c'); | |
update wp_comments set comment_content = replace(comment_content,'‡','c'); | |
update wp_postmeta set meta_value = replace(meta_value,'‡','c'); | |
update wp_posts set post_content = replace(post_content,'â€','"'); | |
update wp_posts set post_title = replace(post_title,'â€','"'); | |
update wp_comments set comment_content = replace(comment_content,'â€','"'); | |
update wp_postmeta set meta_value = replace(meta_value,'â€','"'); | |
update wp_posts set post_content = replace(post_content,'Â',''); | |
update wp_posts set post_title = replace(post_title,'Â',''); | |
update wp_comments set comment_content = replace(comment_content,'Â',''); | |
update wp_postmeta set meta_value = replace(meta_value,'Â',''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
UPDATE
wp_posts
SETpost_content
= replace(post_content,'0000-000-0000','0800-0000-0000');UPDATE
wp_posts
SETpost_title
= replace(post_title,'0000-0000-0000','0000-0000-0000');UPDATE
wp_postmeta
SETmeta_value
= replace(meta_value,'0000-0000-0000','0000-0000-0000');UPDATE
wp_posts
SETpost_content
= replace(post_content,'0000 0000 0000','0000-0000-0000');UPDATE
wp_posts
SETpost_title
= replace(post_title,'0000 0000 0000','0000-0000-0000');UPDATE
wp_postmeta
SETmeta_value
= replace(meta_value,'0000 0000 0000','0000-0000-0000');