Here is how to remove the p tag from automatically generating when you use the_content.

In the template file you want to strip the p tag from simply add the following code anywhere above the “the_content” area.

// Prevent WordPress from adding <p> tags
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

Leave a Reply

Get in Touch

Please fill out the form below and we will get back to you ASAP

  • This field is for validation purposes and should be left unchanged.