WordPress Remove Auto Line Breaks From Content and Excerpt Remove the Filters


Example

// Remove the auto-paragraph and auto-line-break from the content
remove_filter( 'the_content', 'wpautop' );

// Remove the auto-paragraph and auto-line-break from the excerpt
remove_filter( 'the_excerpt', 'wpautop' );