I'm trying to purge my WordPress content from "false" carriage return (CR). These are caused after a migration of my content, that now presents from time to time a
code that makes the web rendering engine to "paint" a CR where I would like to be nothing. The paragraphs seem to have a double CR because of this, and look too far apart.
I'd like to be able to make a MySQL query in order to get rid of that strings, but at the moment I haven't found the key. What I've tried is
UPDATE wp_posts set post_content = replace (post_content,' ',' ');
But i get
<p> </p>
where before were the
strings. This seems not the answer at all. Could it have to be with the ampersand, and in that case, should I use something like &nbsp;
or something similar?
I am not sure why
would be interpreted as a carriage return, because it should look like a space (Non-Breaking SPace). In any case, I was able to get your SQL to work on a test database I created by changing the string to have double-quotes.UPDATE wp_posts set post_content = replace (post_content," ","");
Also note, there is no space between the last pair. You want it to replace
with nothing, not a space.The code
<p> </p>
is frequently used by some GUI HTML editors to represent a carriage return. I would be that what you really need to be searching for and removing is<p> </p>
, and not just
which is just a non-breaking space character.You now might have cases with
<p></p>
since you've replaced the
s with empty strings.