Steve Taylor photo

Get rid of BR tags inserted by WordPress

Even these days, WordPress will often mess with HTML code entered into posts or pages. The most persistent problem I’ve found has been its penchant for inserting
tags inside forms.

No, I’ve not found a way to stop it. Just a slightly lateral workaround: create the following generic class in your stylesheet and apply it to any form (or other containing element) where unwanted
s are being slipped in:

.nobr br {display: none;}

If you’re using
tags yourself in that bit… well, you can always use a bit of a margin, eh?