How to Stop WordPress from Adding 'P' Tags and Line Breaks in Post Content?

stop wordpress from adding p tags

Often while updating pages or posts in WordPress, it automatically adds p and br tags automatically at the end of paragraphs. This behavior specially happens when copying text from HTML file to the WordPress editor. This can be really frustrating and keeps on messing with the page structure.

There are 2 ways of fixing this issue :

1. Fixing using plugins.

There are plugins available that help fix this issue. Some of the popular plugins are :

a. Disable Automatic P Tags
b. PS Disable Auto Formatting
c. Remove P
d. Toggle wpautop

There are many other plugins available as well, but these are some of the most popular available plugins.

2. Adding code to the Theme templates.

Sometimes plugins don't work on your setup or certain plugins running together might break your site. In such cases, just add the following line to the top of your theme's page and post templates.

Usually these files can be found under '...wp-contents/themes/mytheme/' folder with the name 'single.php' and 'page.php'

remove_filter ('the_content', 'wpautop'); 

WPOven

We are sure you are liking our product and quite sure that you will love what we have to offer. WPOven offers dedicated servers, you can host unlimited sites with us. We don't restrict you with any additional costs.

Plans & Features

Get FREE SSD, Business emails, SSL certificate, Get offsite backups for 14 days, Daily malware scanning & clean up. With plans starting just $16.61.

© 2024 WPOven Inc. All rights reserved. WPOven® and WordPress® are registered trademarks.
WPOven is the best Managed WordPress hosting for agencies and businesses that want to succeed. With Unlimited sites hosting option, its easy to use and manage, so you can focus on growing your business. 
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram