Questions tagged [wp-autop]

Changes double line-breaks in the text into HTML paragraphs (`<p>...</p>`). WordPress uses it to filter a posts content and its excerpt per default. This function can be used for autocorrecting any HTML saved to the database (or just displayed). Keep in mind that in the background it is using a time extensive regular expression, so it is considered to slow down your requests.

Filter by
Sorted by
Tagged with
22
votes
3answers
5k views

Switch between Visual and HTML tab freely

So this question has been raised many times under different flags, however I'd like to present a unified thread for an ultimate solution to this issue. In WordPress, by default, when switching back ...
36
votes
10answers
75k views

remove empty paragraphs from the_content?

Hey guys, I simply want to prevent the creation of empty paragraphs in my wordpress post. That happens quite often when trying to manually space content. I don't know why this doesn't take effect? /*...
7
votes
3answers
10k views

Remove wpautop from shortcode content / remove whitespace in buffering

I am using the Mailchimp plugin, and it has a shortcode that uses output buffering to grab its widget's code and spit it out in the content. However, the widget code has plenty of white space, so ...
5
votes
6answers
30k views

How to automatically add paragraph tags in the Visual Editor

From my Googling, it appears as though the default behavior in Wordpress is to add paragraphs automatically, but in the HTML view, regardless of what style I choose in the Visual Editor's style drop-...
3
votes
4answers
2k views

Is there un-wp_autop function?

I have a problem with WP that need your help. Some of my posts have content that was applied "wp_autop" filters already. This filter turned all double break lines into <p> tag. I want to the ...
3
votes
1answer
725 views

wpautop() when shortcode attributes are on new lines break args array

I have a custom shortcode tag with a few attributes, and I would like to be able to display its attributes on new lines - to make it more readable to content editors: [component attr1 ="value1" ...
0
votes
1answer
71 views

Format content value from DB outside of WordPress filters

We're using WordPress to maintain data for a site that gets feed into a JSON file. I've noticed that the post content we add to our file is not getting formatted appropriately. So when we feed it to ...
2
votes
2answers
2k views

Is shortcode_unautop() broken?

shortcode_unautop() in /wp-includes/formatting.php is supposed to find shortcodes in a block of text and remove wrapping paragraph tags from them. I've been having issues with paragraph tags making ...
2
votes
1answer
64 views

Why does WP not like my <a> container?

Lately I've been working on some shortcodes where all the elements the shortcode produces are wrapped inside an tag. Unfortunately this is not rendered like wanted, because of the filter wpautop on ...
0
votes
1answer
392 views

Formatting <code>?

I have serious trouble displaying code blocks in my theme. I want to display something like: <something> <something-else> Content </something-else> </...