Remove Weird Special Characters Easily From WordPress Database

Remove weird special characters from WordPress database is sometimes very important for WordPress lovers. First take a look of our first tutorial was 10+ Life Saving WordPress SQL Queries. Do you know about weird characters? For example, if you copy and pasted something from Microsoft word into your blog the characters may be contains some extra things. This called weird characters. If you follow the following query you can do this. This will replacing those characters by the correct characters.

remove weird special characters

You need to backup WordPress database first. If everything messed up then contact with your WordPress hosting provider. Some small and quick tricks for remove weird special characters are given below.

Simply run the following SQL query on your WordPress database, using the command line client or PhpMyAdmin. This will remove weird characters from all your posts and comments.

Don’t forget to backup your database before using this query.
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, ‘…’, ‘…’);
Hope you like this post. If you like this post must share it with your friends from the following share link.