Skip to content

Instantly share code, notes, and snippets.

@boogah
Last active September 28, 2021 21:14
Show Gist options
  • Select an option

  • Save boogah/d624a4c715ec7e938281623ebf8a5dcf to your computer and use it in GitHub Desktop.

Select an option

Save boogah/d624a4c715ec7e938281623ebf8a5dcf to your computer and use it in GitHub Desktop.
Import these SQL files when you see weird crud in your posts/comments/etc. after migrating your WordPress install or upgrading MySQL on your server. *Note:* You may need to do a find/replace on the prefix in each `.sql` file if your WordPress install is not set to use the usual default of `wp_`.
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, '¤', '¤');
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, '¬', '¬');
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, '´', '´');
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, '¼', '¼');
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, 'Ä', 'Ä');
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, 'ÃŒ', 'Ì');
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, 'Ô', 'Ô');
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, 'Ü', 'Ü');
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, 'ä', 'ä');
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, 'ì', 'ì');
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, 'ô', 'ô');
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, 'ü', 'ü');
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_postmeta set meta_value = replace(meta_value, 'â€', '"');
update wp_postmeta set meta_value = replace(meta_value, '–', '–');
update wp_postmeta set meta_value = replace(meta_value, '•', '-');
update wp_postmeta set meta_value = replace(meta_value, '“', '"');
update wp_postmeta set meta_value = replace(meta_value, '¡', '¡');
update wp_postmeta set meta_value = replace(meta_value, '¢', '¢');
update wp_postmeta set meta_value = replace(meta_value, '£', '£');
update wp_postmeta set meta_value = replace(meta_value, '¤', '¤');
update wp_postmeta set meta_value = replace(meta_value, 'Â¥', '¥');
update wp_postmeta set meta_value = replace(meta_value, '¦', '¦');
update wp_postmeta set meta_value = replace(meta_value, '§', '§');
update wp_postmeta set meta_value = replace(meta_value, '¨', '¨');
update wp_postmeta set meta_value = replace(meta_value, '©', '©');
update wp_postmeta set meta_value = replace(meta_value, 'ª', 'ª');
update wp_postmeta set meta_value = replace(meta_value, '«', '«');
update wp_postmeta set meta_value = replace(meta_value, '¬', '¬');
update wp_postmeta set meta_value = replace(meta_value, '­', '­');
update wp_postmeta set meta_value = replace(meta_value, '®', '®');
update wp_postmeta set meta_value = replace(meta_value, '¯', '¯');
update wp_postmeta set meta_value = replace(meta_value, '°', '°');
update wp_postmeta set meta_value = replace(meta_value, '±', '±');
update wp_postmeta set meta_value = replace(meta_value, '²', '²');
update wp_postmeta set meta_value = replace(meta_value, '³', '³');
update wp_postmeta set meta_value = replace(meta_value, '´', '´');
update wp_postmeta set meta_value = replace(meta_value, 'µ', 'µ');
update wp_postmeta set meta_value = replace(meta_value, '¶', '¶');
update wp_postmeta set meta_value = replace(meta_value, '·', '·');
update wp_postmeta set meta_value = replace(meta_value, '¸', '¸');
update wp_postmeta set meta_value = replace(meta_value, '¹', '¹');
update wp_postmeta set meta_value = replace(meta_value, 'º', 'º');
update wp_postmeta set meta_value = replace(meta_value, '»', '»');
update wp_postmeta set meta_value = replace(meta_value, '¼', '¼');
update wp_postmeta set meta_value = replace(meta_value, '½', '½');
update wp_postmeta set meta_value = replace(meta_value, '¾', '¾');
update wp_postmeta set meta_value = replace(meta_value, '¿', '¿');
update wp_postmeta set meta_value = replace(meta_value, 'À', 'À');
update wp_postmeta set meta_value = replace(meta_value, 'Ã', 'Á');
update wp_postmeta set meta_value = replace(meta_value, 'Â', 'Â');
update wp_postmeta set meta_value = replace(meta_value, 'Ã', 'Ã');
update wp_postmeta set meta_value = replace(meta_value, 'Ä', 'Ä');
update wp_postmeta set meta_value = replace(meta_value, 'Ã…', 'Å');
update wp_postmeta set meta_value = replace(meta_value, 'Æ', 'Æ');
update wp_postmeta set meta_value = replace(meta_value, 'Ç', 'Ç');
update wp_postmeta set meta_value = replace(meta_value, 'È', 'È');
update wp_postmeta set meta_value = replace(meta_value, 'É', 'É');
update wp_postmeta set meta_value = replace(meta_value, 'Ê', 'Ê');
update wp_postmeta set meta_value = replace(meta_value, 'Ë', 'Ë');
update wp_postmeta set meta_value = replace(meta_value, 'ÃŒ', 'Ì');
update wp_postmeta set meta_value = replace(meta_value, 'Ã', 'Í');
update wp_postmeta set meta_value = replace(meta_value, 'ÃŽ', 'Î');
update wp_postmeta set meta_value = replace(meta_value, 'Ã', 'Ï');
update wp_postmeta set meta_value = replace(meta_value, 'Ã', 'Ð');
update wp_postmeta set meta_value = replace(meta_value, 'Ñ', 'Ñ');
update wp_postmeta set meta_value = replace(meta_value, 'Ã’', 'Ò');
update wp_postmeta set meta_value = replace(meta_value, 'Ó', 'Ó');
update wp_postmeta set meta_value = replace(meta_value, 'Ô', 'Ô');
update wp_postmeta set meta_value = replace(meta_value, 'Õ', 'Õ');
update wp_postmeta set meta_value = replace(meta_value, 'Ö', 'Ö');
update wp_postmeta set meta_value = replace(meta_value, '×', '×');
update wp_postmeta set meta_value = replace(meta_value, 'Ø', 'Ø');
update wp_postmeta set meta_value = replace(meta_value, 'Ù', 'Ù');
update wp_postmeta set meta_value = replace(meta_value, 'Ú', 'Ú');
update wp_postmeta set meta_value = replace(meta_value, 'Û', 'Û');
update wp_postmeta set meta_value = replace(meta_value, 'Ü', 'Ü');
update wp_postmeta set meta_value = replace(meta_value, 'Ã', 'Ý');
update wp_postmeta set meta_value = replace(meta_value, 'Þ', 'Þ');
update wp_postmeta set meta_value = replace(meta_value, 'ß', 'ß');
update wp_postmeta set meta_value = replace(meta_value, 'Ã ', 'à');
update wp_postmeta set meta_value = replace(meta_value, 'á', 'á');
update wp_postmeta set meta_value = replace(meta_value, 'â', 'â');
update wp_postmeta set meta_value = replace(meta_value, 'ã', 'ã');
update wp_postmeta set meta_value = replace(meta_value, 'ä', 'ä');
update wp_postmeta set meta_value = replace(meta_value, 'Ã¥', 'å');
update wp_postmeta set meta_value = replace(meta_value, 'æ', 'æ');
update wp_postmeta set meta_value = replace(meta_value, 'ç', 'ç');
update wp_postmeta set meta_value = replace(meta_value, 'è', 'è');
update wp_postmeta set meta_value = replace(meta_value, 'é', 'é');
update wp_postmeta set meta_value = replace(meta_value, 'ê', 'ê');
update wp_postmeta set meta_value = replace(meta_value, 'ë', 'ë');
update wp_postmeta set meta_value = replace(meta_value, 'ì', 'ì');
update wp_postmeta set meta_value = replace(meta_value, '­­Ã', 'í');
update wp_postmeta set meta_value = replace(meta_value, 'î', 'î');
update wp_postmeta set meta_value = replace(meta_value, 'ï', 'ï');
update wp_postmeta set meta_value = replace(meta_value, 'ð', 'ð');
update wp_postmeta set meta_value = replace(meta_value, 'ñ', 'ñ');
update wp_postmeta set meta_value = replace(meta_value, 'ò', 'ò');
update wp_postmeta set meta_value = replace(meta_value, 'ó', 'ó');
update wp_postmeta set meta_value = replace(meta_value, 'ô', 'ô');
update wp_postmeta set meta_value = replace(meta_value, 'õ', 'õ');
update wp_postmeta set meta_value = replace(meta_value, 'ö', 'ö');
update wp_postmeta set meta_value = replace(meta_value, '÷', '÷');
update wp_postmeta set meta_value = replace(meta_value, 'ø', 'ø');
update wp_postmeta set meta_value = replace(meta_value, 'ù', 'ù');
update wp_postmeta set meta_value = replace(meta_value, 'ú', 'ú');
update wp_postmeta set meta_value = replace(meta_value, 'û', 'û');
update wp_postmeta set meta_value = replace(meta_value, 'ü', 'ü');
update wp_postmeta set meta_value = replace(meta_value, 'ý', 'ý');
update wp_postmeta set meta_value = replace(meta_value, 'þ', 'þ');
update wp_postmeta set meta_value = replace(meta_value, 'ÿ', 'ÿ');
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, 'Â¥', '¥');
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, '®', '®');
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, '·', '·');
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, 'À', 'À');
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, 'É', 'É');
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, 'Ã’', 'Ò');
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, 'Û', 'Û');
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, 'ä', 'ä');
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, '­­Ã', 'í');
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, 'ö', 'ö');
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, 'ÿ', 'ÿ');
update wp_posts set post_excerpt = replace(post_excerpt, 'â€', '"');
update wp_posts set post_excerpt = replace(post_excerpt, '–', '–');
update wp_posts set post_excerpt = replace(post_excerpt, '•', '-');
update wp_posts set post_excerpt = replace(post_excerpt, '“', '"');
update wp_posts set post_excerpt = replace(post_excerpt, '¡', '¡');
update wp_posts set post_excerpt = replace(post_excerpt, '¢', '¢');
update wp_posts set post_excerpt = replace(post_excerpt, '£', '£');
update wp_posts set post_excerpt = replace(post_excerpt, '¤', '¤');
update wp_posts set post_excerpt = replace(post_excerpt, 'Â¥', '¥');
update wp_posts set post_excerpt = replace(post_excerpt, '¦', '¦');
update wp_posts set post_excerpt = replace(post_excerpt, '§', '§');
update wp_posts set post_excerpt = replace(post_excerpt, '¨', '¨');
update wp_posts set post_excerpt = replace(post_excerpt, '©', '©');
update wp_posts set post_excerpt = replace(post_excerpt, 'ª', 'ª');
update wp_posts set post_excerpt = replace(post_excerpt, '«', '«');
update wp_posts set post_excerpt = replace(post_excerpt, '¬', '¬');
update wp_posts set post_excerpt = replace(post_excerpt, '­', '­');
update wp_posts set post_excerpt = replace(post_excerpt, '®', '®');
update wp_posts set post_excerpt = replace(post_excerpt, '¯', '¯');
update wp_posts set post_excerpt = replace(post_excerpt, '°', '°');
update wp_posts set post_excerpt = replace(post_excerpt, '±', '±');
update wp_posts set post_excerpt = replace(post_excerpt, '²', '²');
update wp_posts set post_excerpt = replace(post_excerpt, '³', '³');
update wp_posts set post_excerpt = replace(post_excerpt, '´', '´');
update wp_posts set post_excerpt = replace(post_excerpt, 'µ', 'µ');
update wp_posts set post_excerpt = replace(post_excerpt, '¶', '¶');
update wp_posts set post_excerpt = replace(post_excerpt, '·', '·');
update wp_posts set post_excerpt = replace(post_excerpt, '¸', '¸');
update wp_posts set post_excerpt = replace(post_excerpt, '¹', '¹');
update wp_posts set post_excerpt = replace(post_excerpt, 'º', 'º');
update wp_posts set post_excerpt = replace(post_excerpt, '»', '»');
update wp_posts set post_excerpt = replace(post_excerpt, '¼', '¼');
update wp_posts set post_excerpt = replace(post_excerpt, '½', '½');
update wp_posts set post_excerpt = replace(post_excerpt, '¾', '¾');
update wp_posts set post_excerpt = replace(post_excerpt, '¿', '¿');
update wp_posts set post_excerpt = replace(post_excerpt, 'À', 'À');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ã', 'Á');
update wp_posts set post_excerpt = replace(post_excerpt, 'Â', 'Â');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ã', 'Ã');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ä', 'Ä');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ã…', 'Å');
update wp_posts set post_excerpt = replace(post_excerpt, 'Æ', 'Æ');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ç', 'Ç');
update wp_posts set post_excerpt = replace(post_excerpt, 'È', 'È');
update wp_posts set post_excerpt = replace(post_excerpt, 'É', 'É');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ê', 'Ê');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ë', 'Ë');
update wp_posts set post_excerpt = replace(post_excerpt, 'ÃŒ', 'Ì');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ã', 'Í');
update wp_posts set post_excerpt = replace(post_excerpt, 'ÃŽ', 'Î');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ã', 'Ï');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ã', 'Ð');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ñ', 'Ñ');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ã’', 'Ò');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ó', 'Ó');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ô', 'Ô');
update wp_posts set post_excerpt = replace(post_excerpt, 'Õ', 'Õ');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ö', 'Ö');
update wp_posts set post_excerpt = replace(post_excerpt, '×', '×');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ø', 'Ø');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ù', 'Ù');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ú', 'Ú');
update wp_posts set post_excerpt = replace(post_excerpt, 'Û', 'Û');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ü', 'Ü');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ã', 'Ý');
update wp_posts set post_excerpt = replace(post_excerpt, 'Þ', 'Þ');
update wp_posts set post_excerpt = replace(post_excerpt, 'ß', 'ß');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ã ', 'à');
update wp_posts set post_excerpt = replace(post_excerpt, 'á', 'á');
update wp_posts set post_excerpt = replace(post_excerpt, 'â', 'â');
update wp_posts set post_excerpt = replace(post_excerpt, 'ã', 'ã');
update wp_posts set post_excerpt = replace(post_excerpt, 'ä', 'ä');
update wp_posts set post_excerpt = replace(post_excerpt, 'Ã¥', 'å');
update wp_posts set post_excerpt = replace(post_excerpt, 'æ', 'æ');
update wp_posts set post_excerpt = replace(post_excerpt, 'ç', 'ç');
update wp_posts set post_excerpt = replace(post_excerpt, 'è', 'è');
update wp_posts set post_excerpt = replace(post_excerpt, 'é', 'é');
update wp_posts set post_excerpt = replace(post_excerpt, 'ê', 'ê');
update wp_posts set post_excerpt = replace(post_excerpt, 'ë', 'ë');
update wp_posts set post_excerpt = replace(post_excerpt, 'ì', 'ì');
update wp_posts set post_excerpt = replace(post_excerpt, '­­Ã', 'í');
update wp_posts set post_excerpt = replace(post_excerpt, 'î', 'î');
update wp_posts set post_excerpt = replace(post_excerpt, 'ï', 'ï');
update wp_posts set post_excerpt = replace(post_excerpt, 'ð', 'ð');
update wp_posts set post_excerpt = replace(post_excerpt, 'ñ', 'ñ');
update wp_posts set post_excerpt = replace(post_excerpt, 'ò', 'ò');
update wp_posts set post_excerpt = replace(post_excerpt, 'ó', 'ó');
update wp_posts set post_excerpt = replace(post_excerpt, 'ô', 'ô');
update wp_posts set post_excerpt = replace(post_excerpt, 'õ', 'õ');
update wp_posts set post_excerpt = replace(post_excerpt, 'ö', 'ö');
update wp_posts set post_excerpt = replace(post_excerpt, '÷', '÷');
update wp_posts set post_excerpt = replace(post_excerpt, 'ø', 'ø');
update wp_posts set post_excerpt = replace(post_excerpt, 'ù', 'ù');
update wp_posts set post_excerpt = replace(post_excerpt, 'ú', 'ú');
update wp_posts set post_excerpt = replace(post_excerpt, 'û', 'û');
update wp_posts set post_excerpt = replace(post_excerpt, 'ü', 'ü');
update wp_posts set post_excerpt = replace(post_excerpt, 'ý', 'ý');
update wp_posts set post_excerpt = replace(post_excerpt, 'þ', 'þ');
update wp_posts set post_excerpt = replace(post_excerpt, 'ÿ', 'ÿ');
update wp_posts set post_title = replace(post_title, 'â€', '"');
update wp_posts set post_title = replace(post_title, '–', '–');
update wp_posts set post_title = replace(post_title, '•', '-');
update wp_posts set post_title = replace(post_title, '“', '"');
update wp_posts set post_title = replace(post_title, '¡', '¡');
update wp_posts set post_title = replace(post_title, '¢', '¢');
update wp_posts set post_title = replace(post_title, '£', '£');
update wp_posts set post_title = replace(post_title, '¤', '¤');
update wp_posts set post_title = replace(post_title, 'Â¥', '¥');
update wp_posts set post_title = replace(post_title, '¦', '¦');
update wp_posts set post_title = replace(post_title, '§', '§');
update wp_posts set post_title = replace(post_title, '¨', '¨');
update wp_posts set post_title = replace(post_title, '©', '©');
update wp_posts set post_title = replace(post_title, 'ª', 'ª');
update wp_posts set post_title = replace(post_title, '«', '«');
update wp_posts set post_title = replace(post_title, '¬', '¬');
update wp_posts set post_title = replace(post_title, '­', '­');
update wp_posts set post_title = replace(post_title, '®', '®');
update wp_posts set post_title = replace(post_title, '¯', '¯');
update wp_posts set post_title = replace(post_title, '°', '°');
update wp_posts set post_title = replace(post_title, '±', '±');
update wp_posts set post_title = replace(post_title, '²', '²');
update wp_posts set post_title = replace(post_title, '³', '³');
update wp_posts set post_title = replace(post_title, '´', '´');
update wp_posts set post_title = replace(post_title, 'µ', 'µ');
update wp_posts set post_title = replace(post_title, '¶', '¶');
update wp_posts set post_title = replace(post_title, '·', '·');
update wp_posts set post_title = replace(post_title, '¸', '¸');
update wp_posts set post_title = replace(post_title, '¹', '¹');
update wp_posts set post_title = replace(post_title, 'º', 'º');
update wp_posts set post_title = replace(post_title, '»', '»');
update wp_posts set post_title = replace(post_title, '¼', '¼');
update wp_posts set post_title = replace(post_title, '½', '½');
update wp_posts set post_title = replace(post_title, '¾', '¾');
update wp_posts set post_title = replace(post_title, '¿', '¿');
update wp_posts set post_title = replace(post_title, 'À', 'À');
update wp_posts set post_title = replace(post_title, 'Ã', 'Á');
update wp_posts set post_title = replace(post_title, 'Â', 'Â');
update wp_posts set post_title = replace(post_title, 'Ã', 'Ã');
update wp_posts set post_title = replace(post_title, 'Ä', 'Ä');
update wp_posts set post_title = replace(post_title, 'Ã…', 'Å');
update wp_posts set post_title = replace(post_title, 'Æ', 'Æ');
update wp_posts set post_title = replace(post_title, 'Ç', 'Ç');
update wp_posts set post_title = replace(post_title, 'È', 'È');
update wp_posts set post_title = replace(post_title, 'É', 'É');
update wp_posts set post_title = replace(post_title, 'Ê', 'Ê');
update wp_posts set post_title = replace(post_title, 'Ë', 'Ë');
update wp_posts set post_title = replace(post_title, 'ÃŒ', 'Ì');
update wp_posts set post_title = replace(post_title, 'Ã', 'Í');
update wp_posts set post_title = replace(post_title, 'ÃŽ', 'Î');
update wp_posts set post_title = replace(post_title, 'Ã', 'Ï');
update wp_posts set post_title = replace(post_title, 'Ã', 'Ð');
update wp_posts set post_title = replace(post_title, 'Ñ', 'Ñ');
update wp_posts set post_title = replace(post_title, 'Ã’', 'Ò');
update wp_posts set post_title = replace(post_title, 'Ó', 'Ó');
update wp_posts set post_title = replace(post_title, 'Ô', 'Ô');
update wp_posts set post_title = replace(post_title, 'Õ', 'Õ');
update wp_posts set post_title = replace(post_title, 'Ö', 'Ö');
update wp_posts set post_title = replace(post_title, '×', '×');
update wp_posts set post_title = replace(post_title, 'Ø', 'Ø');
update wp_posts set post_title = replace(post_title, 'Ù', 'Ù');
update wp_posts set post_title = replace(post_title, 'Ú', 'Ú');
update wp_posts set post_title = replace(post_title, 'Û', 'Û');
update wp_posts set post_title = replace(post_title, 'Ü', 'Ü');
update wp_posts set post_title = replace(post_title, 'Ã', 'Ý');
update wp_posts set post_title = replace(post_title, 'Þ', 'Þ');
update wp_posts set post_title = replace(post_title, 'ß', 'ß');
update wp_posts set post_title = replace(post_title, 'Ã ', 'à');
update wp_posts set post_title = replace(post_title, 'á', 'á');
update wp_posts set post_title = replace(post_title, 'â', 'â');
update wp_posts set post_title = replace(post_title, 'ã', 'ã');
update wp_posts set post_title = replace(post_title, 'ä', 'ä');
update wp_posts set post_title = replace(post_title, 'Ã¥', 'å');
update wp_posts set post_title = replace(post_title, 'æ', 'æ');
update wp_posts set post_title = replace(post_title, 'ç', 'ç');
update wp_posts set post_title = replace(post_title, 'è', 'è');
update wp_posts set post_title = replace(post_title, 'é', 'é');
update wp_posts set post_title = replace(post_title, 'ê', 'ê');
update wp_posts set post_title = replace(post_title, 'ë', 'ë');
update wp_posts set post_title = replace(post_title, 'ì', 'ì');
update wp_posts set post_title = replace(post_title, '­­Ã', 'í');
update wp_posts set post_title = replace(post_title, 'î', 'î');
update wp_posts set post_title = replace(post_title, 'ï', 'ï');
update wp_posts set post_title = replace(post_title, 'ð', 'ð');
update wp_posts set post_title = replace(post_title, 'ñ', 'ñ');
update wp_posts set post_title = replace(post_title, 'ò', 'ò');
update wp_posts set post_title = replace(post_title, 'ó', 'ó');
update wp_posts set post_title = replace(post_title, 'ô', 'ô');
update wp_posts set post_title = replace(post_title, 'õ', 'õ');
update wp_posts set post_title = replace(post_title, 'ö', 'ö');
update wp_posts set post_title = replace(post_title, '÷', '÷');
update wp_posts set post_title = replace(post_title, 'ø', 'ø');
update wp_posts set post_title = replace(post_title, 'ù', 'ù');
update wp_posts set post_title = replace(post_title, 'ú', 'ú');
update wp_posts set post_title = replace(post_title, 'û', 'û');
update wp_posts set post_title = replace(post_title, 'ü', 'ü');
update wp_posts set post_title = replace(post_title, 'ý', 'ý');
update wp_posts set post_title = replace(post_title, 'þ', 'þ');
update wp_posts set post_title = replace(post_title, 'ÿ', 'ÿ');
update wp_terms set name = replace(name, 'â€', '"');
update wp_terms set name = replace(name, '–', '–');
update wp_terms set name = replace(name, '•', '-');
update wp_terms set name = replace(name, '“', '"');
update wp_terms set name = replace(name, '¡', '¡');
update wp_terms set name = replace(name, '¢', '¢');
update wp_terms set name = replace(name, '£', '£');
update wp_terms set name = replace(name, '¤', '¤');
update wp_terms set name = replace(name, 'Â¥', '¥');
update wp_terms set name = replace(name, '¦', '¦');
update wp_terms set name = replace(name, '§', '§');
update wp_terms set name = replace(name, '¨', '¨');
update wp_terms set name = replace(name, '©', '©');
update wp_terms set name = replace(name, 'ª', 'ª');
update wp_terms set name = replace(name, '«', '«');
update wp_terms set name = replace(name, '¬', '¬');
update wp_terms set name = replace(name, '­', '­');
update wp_terms set name = replace(name, '®', '®');
update wp_terms set name = replace(name, '¯', '¯');
update wp_terms set name = replace(name, '°', '°');
update wp_terms set name = replace(name, '±', '±');
update wp_terms set name = replace(name, '²', '²');
update wp_terms set name = replace(name, '³', '³');
update wp_terms set name = replace(name, '´', '´');
update wp_terms set name = replace(name, 'µ', 'µ');
update wp_terms set name = replace(name, '¶', '¶');
update wp_terms set name = replace(name, '·', '·');
update wp_terms set name = replace(name, '¸', '¸');
update wp_terms set name = replace(name, '¹', '¹');
update wp_terms set name = replace(name, 'º', 'º');
update wp_terms set name = replace(name, '»', '»');
update wp_terms set name = replace(name, '¼', '¼');
update wp_terms set name = replace(name, '½', '½');
update wp_terms set name = replace(name, '¾', '¾');
update wp_terms set name = replace(name, '¿', '¿');
update wp_terms set name = replace(name, 'À', 'À');
update wp_terms set name = replace(name, 'Ã', 'Á');
update wp_terms set name = replace(name, 'Â', 'Â');
update wp_terms set name = replace(name, 'Ã', 'Ã');
update wp_terms set name = replace(name, 'Ä', 'Ä');
update wp_terms set name = replace(name, 'Ã…', 'Å');
update wp_terms set name = replace(name, 'Æ', 'Æ');
update wp_terms set name = replace(name, 'Ç', 'Ç');
update wp_terms set name = replace(name, 'È', 'È');
update wp_terms set name = replace(name, 'É', 'É');
update wp_terms set name = replace(name, 'Ê', 'Ê');
update wp_terms set name = replace(name, 'Ë', 'Ë');
update wp_terms set name = replace(name, 'ÃŒ', 'Ì');
update wp_terms set name = replace(name, 'Ã', 'Í');
update wp_terms set name = replace(name, 'ÃŽ', 'Î');
update wp_terms set name = replace(name, 'Ã', 'Ï');
update wp_terms set name = replace(name, 'Ã', 'Ð');
update wp_terms set name = replace(name, 'Ñ', 'Ñ');
update wp_terms set name = replace(name, 'Ã’', 'Ò');
update wp_terms set name = replace(name, 'Ó', 'Ó');
update wp_terms set name = replace(name, 'Ô', 'Ô');
update wp_terms set name = replace(name, 'Õ', 'Õ');
update wp_terms set name = replace(name, 'Ö', 'Ö');
update wp_terms set name = replace(name, '×', '×');
update wp_terms set name = replace(name, 'Ø', 'Ø');
update wp_terms set name = replace(name, 'Ù', 'Ù');
update wp_terms set name = replace(name, 'Ú', 'Ú');
update wp_terms set name = replace(name, 'Û', 'Û');
update wp_terms set name = replace(name, 'Ü', 'Ü');
update wp_terms set name = replace(name, 'Ã', 'Ý');
update wp_terms set name = replace(name, 'Þ', 'Þ');
update wp_terms set name = replace(name, 'ß', 'ß');
update wp_terms set name = replace(name, 'Ã ', 'à');
update wp_terms set name = replace(name, 'á', 'á');
update wp_terms set name = replace(name, 'â', 'â');
update wp_terms set name = replace(name, 'ã', 'ã');
update wp_terms set name = replace(name, 'ä', 'ä');
update wp_terms set name = replace(name, 'Ã¥', 'å');
update wp_terms set name = replace(name, 'æ', 'æ');
update wp_terms set name = replace(name, 'ç', 'ç');
update wp_terms set name = replace(name, 'è', 'è');
update wp_terms set name = replace(name, 'é', 'é');
update wp_terms set name = replace(name, 'ê', 'ê');
update wp_terms set name = replace(name, 'ë', 'ë');
update wp_terms set name = replace(name, 'ì', 'ì');
update wp_terms set name = replace(name, '­­Ã', 'í');
update wp_terms set name = replace(name, 'î', 'î');
update wp_terms set name = replace(name, 'ï', 'ï');
update wp_terms set name = replace(name, 'ð', 'ð');
update wp_terms set name = replace(name, 'ñ', 'ñ');
update wp_terms set name = replace(name, 'ò', 'ò');
update wp_terms set name = replace(name, 'ó', 'ó');
update wp_terms set name = replace(name, 'ô', 'ô');
update wp_terms set name = replace(name, 'õ', 'õ');
update wp_terms set name = replace(name, 'ö', 'ö');
update wp_terms set name = replace(name, '÷', '÷');
update wp_terms set name = replace(name, 'ø', 'ø');
update wp_terms set name = replace(name, 'ù', 'ù');
update wp_terms set name = replace(name, 'ú', 'ú');
update wp_terms set name = replace(name, 'û', 'û');
update wp_terms set name = replace(name, 'ü', 'ü');
update wp_terms set name = replace(name, 'ý', 'ý');
update wp_terms set name = replace(name, 'þ', 'þ');
update wp_terms set name = replace(name, 'ÿ', 'ÿ');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment