Stop WordPress Automatically Adding br


WordPress uses a function called wpautop to automatically add paragraphs and line breaks to your content from the content editor. This will change double line breaks and convert them into a HTML paragraph.

This takes two parameters the first being the text that needs to be converted, the second being a boolean value, defaults to true which will take line breaks and convert these to line breaks.

There are certain situations in your editing where you want to stop WordPress automatically adding line breaks in your content. To do . . .

Upgrade to access all content on Paulund

Members unlock all tutorials and snippets

Access to all downloadable content

Access to code examples before others

Sign Up Now

Already a member? Login here

Subscribe To Newsletter

Get weekly updates to your email