I'm new to wordpress and currently developing a theme on it. I have noticed that Wordpress adds <p>
tags all over the page. Do you know any plugin or a workaround to avoid this?
Add this to your functions.php, this should give the result you're looking for:
remove_filter('the_content', 'wpautop');
Try this, assuming you have the html code in variable $html_code
$html_code = preg_replace('/<\/?p>/','', $html_code);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With