1

In my website this characters ​​ showing up on everywhere in blog content and title, after many hours of searching and googling cant find any useful answer i tried this meta but no luck

header("Content-Type: text/html; charset=ISO-8859-1");


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Is there any way to rid-off this ​​ And many other characters: ‘ â

Also tried Plugin search and replace but the character is not searchable.

1

If you search your content for these characters ‘ â � you will not find them, because they are not there. Characters ‘ â � like these are a sign, that the character encoding in the frontend does not match with that from the database. Normaly wordpress used for database, file endcoding and character encoding UTF-8.

  • Thanks for answering, actually I'm trying to add post from my old non wordpress website to wordpress in bulk(approx:7000 post). now after inserting posts in bulk using php script this characters are showing in database so i tried search and replace and some character changed successfully but some don't then i tried UTF8mb4 got success but still showing some charaters, then i tries UTF-8 then again some characters change to normal but not all characters – Dev65 Aug 24 '18 at 11:30
  • Do you try in your import script somethink like the php function utf8_encode? – user141080 Aug 24 '18 at 11:43
  • No I'm using a plugin CSV Importer – Dev65 Aug 24 '18 at 13:46
  • Make sure your CSV has the same encoding as the database before importing ;) Here is a list of all UTF characters that usually go wrong and what to search/replace for i18nqa.com/debug/utf8-debug.html – Jeffrey von Grumbkow Nov 29 '18 at 13:46
1

Found the answer after little bit search on google & http://php.net/manual/en/function.htmlspecialchars-decode.php , After a long time answered my own question thought maybe it will help someone.

htmlspecialchars_decode(utf8_decode(htmlentities(YOUR_STRING, ENT_COMPAT, 'utf-8', false)));
  • This is indeed a solution, but it doesn't solve the actual problem and that's that the characters are encoded wrong in the database. It shouldn't be a solution to change your entire theme for this. Did you by any change migrate your database? Because this always happens when you import a database into a new one with different encoding. – Jeffrey von Grumbkow Nov 29 '18 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.