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.

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

Most Popular Posts

Overview of Views in MySQL

Posted on 6 years ago

Bhumi

Fixed Remove class issue with MooTools

Posted on 12 years ago

Bhumi

How to use Triggers in MySQL

Posted on 12 years ago

Bhumi