Become Wordpress Professional - Your Ultimate Wordpress Guide

Thursday, 23 May 2013

How to Remove Automatic Paragraphs in Wordpress

By default, on the output of the content for wordpress, the content are divided into automatic paragraphs withing the paragraph tags. This situation mainly occurs where the content of a post or a page is outputted using the_content(); function within the loop.

Sometimes these automatic paragraphs tags are rendered even there is no requirement for that. In wordpress we are free to keep this auto paragraphing functionality enabled or disabled.

How to Disable Automatic Paragraphing for Posts and Page content  

In order to disable the automatic paragraph, simply log into the wordpress admin panel of your site. Navigate to Appearance > Editior > Theme Functions (functions.php).

Now simply copy the code below and paste it at the bottom of functions.php file.

//disable automatic paragraphing
remove_filter('the_content', 'wpautop');


Next Save the file.

The code above is basically removing the filter that has been set by default for the posts and page contents that was added by default in wordpress. Now that you have disabled this functionality, you will no longer see automatic paragraph tags but only the ones that you created by yourself.

0 comments:

Post a Comment

Please Avoid Spamming. Comments will be moderated before they are published.