<?php the_content(); ?>
When we use the above the content is published like this →
<p>Content is published</p>
If I want to later this HTML and instead of
<p></p> I want that
<h3></h3> should be there. Is that possible?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
<p> is applied by a filter called
wpautop. You can disable this filter and wrap the content in your desired wrapper, but it's not really recommended.
remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' );
Now you can wrap your content in a DIV for example:
<div><?php the_content(); ?></div>
But notice that this filter is applied to more than just beginning and the end. It's applied to paragraphs and galleries, etc. Disabling it might not have the desired effect.