Back to Top

What is Wpautop() function in WordPress

Wpautop() function in WordPress

WordPress is the best solution for many of bloggers and site builders because it provides a flexible, extendable, and quick way to build robust websites that non-technical person could manage on their own.

About Wpautop() function

The wpautop function is used to automatically formats posts in WordPress.Wpautop is especially used to automatic formatting a paragraph.Wpautop filter which will change double line breaks into paragraph tags.Whenever you add content using TinyMCE editor and add a new line then will create a double line break which might not look better so this filter solves this problem.

First of all, Let’s understand wpautop if you are confused about what this function does and how to use it.

For example, you have typed following line of code into visual editor on a post

Output:

Read: To add new URL rewrite rule in WordPress

Here, I am going to share function which is used to reverse the Wpautop functionality in WordPress.

This function is used to reverse the effect of wpautop() function.Permanently removing wpautop is not useful every time so you can use this function and call when you want for turning reversing the “p” and “br” tags to newlines. It will check p and br tags and replaces with the newline character, provides the clean string to you.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

How to use Mixins in LESS CSS?

Posted on 10 years ago

Bhumi

How to use HTML5 Constraint Validation

Posted on 9 years ago

Bhumi

How to use HTML5 AutoFocus attribute

Posted on 9 years ago

Bhumi