In transferring a WP site from one domain to another (export, import, etc.), some characters were acting up. Smart quotes (e.g. — ” — and — ” — instead of just — ” — between the dashes to show what I mean–ha, I just looked and they don’t show up here!) and em-dashes (” — ” and not just a dash ” – “) were putting odd code into the new site. In WP, I could just see these little diamonds with a question mark in them, but couldn’t use search and replace because I couldn’t copy and paste the diamond. Solution: get down and dirty with PHP MyAdmin to edit your SQL database. To those I just lost in translation, you’re free to leave the room now.
Here’s the code to put into an SQL query:
If you don’t know what you’re doing, please don’t even go near this. It’s a jungle in there. :-)
I have to say, I just encountered this issue tonight, and a quick google search brought me to your page. Thank you!
P.S. Any idea on how to use that function to change those fancy apostrophes to a regular one? I’m stuck at that. :/
I think if you can copy and then paste the fancy apostrophes in there, they will be different and you can then replace them. The fancy ones are slanted whereas the plain ones are vertical. Let me know if that worked! — Bradley
It didn’t, but using the fancy apostrophes as what to find and replacing them with the simple code for an apostrophe, which I believe is “'”, worked like a charm!
Thanks again. I had to transfer a wordpress database containing about six years of continual posting – about 180mb total – and after I had done that, table by table, seeing those weird symbols in place of the quotes and apostrophes made me want to cry!
I would to thank you for saving me a lot of time, I used your string and it replaced new video coordinates for my new theme
Affected rows: 25000 (Query took 3.0200 sec)
this code just saved me weeks of work :) ..
i used this code to change the tagged from being sperated with black space to being sperated with commos…
thanks..