Unwanted <p> tags added by WordPress
I prefer to edit raw HTML for my content and have been bothered by WordPress adding <p> and <br /> tags at newlines in the source. I initially thought this had something to do with the editor, even though I had checked Disable the visual editor when writing in my profile settings. Actually, the newline substitution is done by WordPress in a filter called, not surprisingly, wpautop. I commented out the following line in wp-includes/default-filters.php and the problem is gone.
// add_filter('the_content', 'wpautop');
Thanks to WordPress › Support » Unwanted <p> tags added to pages.

Leave a reply