[solution][wordpress] Problems with HTML spaces and breaks (%nbsp;,<br>), WP removes them from content

By.

min read

My profile

Share this:

I had asked this on the WordPress linkedin groups ( of which I moderate the Dutch group at http://www.linkedin.com/groups?home=&gid=1644947&trk=anet_ug_hm ).

[quote:b625517ea8]I have some clients reporting to me that every time they enter a space or a break (%nbsp;,<br>) in the page/post editor ( WYSIWYG or HTML tab ) … WordPress removes this when saving.

I have tested this on a vanilla 2.9.1 install ( so no plugins, just a straight install from the zip source ) and this turns out to be true.

Is this a bug or a feature? I don’t want to edit the WP core files to “fix” this. [/quote:b625517ea8]

Wim La Haye ( http://nl.linkedin.com/in/lahaye ) suggested:
[quote:b625517ea8]Hey Ramon,

This is caused by a wordpress function “wpautop” (wordpress auto paragraph) which formats double line breaks to paragraphs.

The function is described here:
http://codex.wordpress.org/Function_Reference/wpautop

There are multiple plugins avaiable to counteract/disable the wpautop. Among others “disable-wpautop” ( http://urbangiraffe.com/plugins/disable-wpautop/ )[/quote:b625517ea8]

The problem with spacing still remains …

Share this:

Leave a Reply

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