Fix WordPress UTF-8 corrupt characters

When deploying or moving wordpress sites between hosts, there might be issues with SQL dumps or server charset algorithms that corrupt the utf8 characters to two byte equivalents. To solve this in comments, run this command in phpmyadmin or other tool on your server:

For comments:

alter table wp_comments modify comment_content tinytext character set latin1;
alter table wp_comments modify comment_content blob;
alter table wp_comments modify comment_content tinytext character set utf8;
alter table wp_comments modify comment_author tinytext character set latin1;
alter table wp_comments modify comment_author blob;
alter table wp_comments modify comment_author tinytext character set utf8;

For posts:

alter table wp_posts modify post_author tinytext character set latin1;
alter table wp_posts modify post_author blob;
alter table wp_posts modify post_author tinytext character set utf8;
alter table wp_posts modify post_content tinytext character set latin1;
alter table wp_posts modify post_content blob;
alter table wp_posts modify post_content tinytext character set utf8;

Leave a Reply

Your email address will not be published. Required fields are marked *