{"id":356,"date":"2009-08-01T20:56:37","date_gmt":"2009-08-01T19:56:37","guid":{"rendered":"http:\/\/www.simonbattersby.com\/blog\/?p=356"},"modified":"2010-10-29T13:16:46","modified_gmt":"2010-10-29T12:16:46","slug":"stop-wordpress-adding-br-tags","status":"publish","type":"post","link":"https:\/\/www.simonbattersby.com\/blog\/2009\/08\/stop-wordpress-adding-br-tags\/","title":{"rendered":"Stop WordPress adding &lt;br\/&gt; tags"},"content":{"rendered":"<p>Been swearing at WordPress this afternoon&#8230;<\/p>\r\n\r\n<p>I&#8217;ve been trying to transfer an html form, which I had working perfectly on a static html page, onto a WordPress page. WordPress insisted on adding multiple &lt;br\/&gt; tags where I didn&#8217;t want them. Mutter.<\/p>\r\n\r\n<p>Eventually, after much searching, I identified a parameter within wp-includes\/formatting.php, which allows you to disable this irritating feature. If you open formatting.php and find the function wpautop you&#8217;ll see this:<\/p>\r\n\r\n<pre>function wpautop($pee, $br = 1)<\/pre>\r\n\r\n<p>Change this to:<\/p>\r\n\r\n<pre>function wpautop($pee, $br = 0)<\/pre>\r\n\r\n<p>Save the file and publish it back to your server and that&#8217;s it. Works fine in WP2.8.<\/p>\r\n\r\n<p>Note: WP 2.8.3 overwrites formatting.php so this change needs redoing.<\/p>\r\n\r\n<h3 class=\"orange\"><span>Update 24 October 2010<\/span><\/h3>\r\n\r\n<p>Fed up with repeatedly doing this I&#8217;ve developed a <a href=\"\/blog\/plugin-to-stop-wordpress-adding-br-tags\/\" title=\"Wordpress plugin to stop &lt;br\/&gt; being added\">WordPress plugin<\/a> to address the issue. Give it a try and let me know if it works for you.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Been swearing at WordPress this afternoon&#8230; I&#8217;ve been trying to transfer an html form, which I had working perfectly on a static html page, onto a WordPress page. WordPress insisted on adding multiple &lt;br\/&gt; tags where I didn&#8217;t want them. Mutter. Eventually, after much searching, I identified a parameter within wp-includes\/formatting.php, which allows you to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[17,10],"class_list":["post-356","post","type-post","status-publish","format-standard","hentry","category-web-design-and-build","tag-linkedin","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/posts\/356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/comments?post=356"}],"version-history":[{"count":0,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/posts\/356\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/media?parent=356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/categories?post=356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/tags?post=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}