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.
82 questions
1 vote
1 answer
113 views
shortcode causes broken paragraph tags
I'm learning how to use short codes but I don't undrestand why WordPress keeps rendering broken paragraph tags. I created a file called wp-content/themes/twentytwentythree/templates/single.html with ...
0 votes
0 answers
142 views
What hook runs wpautop on template content?
I have a shortcode that outputs HTML and I've inserted it into a single post template. The output gets extraneous <br/> and <p> tags, which I've read in other topics are likely due to ...
0 votes
0 answers
65 views
Line Breaks are stripped off when direction property is found
The line breaks are stripped off when the p tag has a dir attribute inserted, to explain further I'll list some examples. Let's say we have 2 lines of text as following <p>Text Paragraph Number ...
0 votes
0 answers
319 views
Disable wpautop on Shortcode attributes
I have a shortcode which accepts basic HTML tags as shortcode attribute. When this shortcode is used in the shortcode block i.e within <!-- wp:shortcode --> then unbalanced <p> tags are ...
1 vote
0 answers
797 views
Removing "wpautop" (auto <p> tags) only on certain pages?
I'm using the remove_filter in functions.php to remove the auto insertion of <p> and <br> tags on my wordpress site. remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt'...
1 vote
0 answers
395 views
wpautop is not working when displaying content saved using wp_editor in a custom meta box
I am using wp_editor in a custom meta box. It is saving the content to the post metadata. And displaying it in the meta box as it should. The problem is when I am trying to display this content on ...
1 vote
0 answers
654 views
Removing line breaks when in text view with wp_editor
While working on a custom plugin, I needed to add the wp_editor in the admin to let the user add its own content. I want the user to be able to write custom rich texts with the "Visual" editor mode ...
-1 votes
1 answer
1k views
How to disable auto-p in WordPress?
I need to remove the "wpautop filter" from my WordPress Website because it is adding too many paragraphs. I'm new to WordPress. I don't know how to create Child themes. The name of my theme is the "...
0 votes
0 answers
340 views
Wordpress not saving <p> tags for custom taxonomy term description
I'm using wordpress API to display content. I'm using the classic editor since guttenberg is bugging out elsewhere. I noticed that if a paragraph does not have inline styles, wordpress does not save ...
1 vote
1 answer
4k views
How to call a PHP function in WordPress when you click on a button?
How to process the textarea field with the standard WordPress function wpautop() when clicking the button? Here's the form: <textarea id="my_ta">Lorem ipsum!</textarea> <button id="...
0 votes
1 answer
272 views
Shortcodes within the sidebar text/html widget: How to preserve the raw HTML output of the shortcode?
WordPress 5.2 destroys structured data by adding rel="noopener noreferrer" to widget output (also to shortcodes): How to display the shortcode output without code change? This feature was added in 5....
3 votes
1 answer
9k views
WooCommerce Description and Short Description <p> tags removal
When adding content into the description and short description fields for a product, line-breaks and tags are completely removed from the markup. Other than installing Advanced TinyMCE, is there any ...
2 votes
3 answers
5k views
Remove empty p-Tags in Shortcode content before non p-Tags
We build a media (based on bootstrap 4 media object) shortcode with the following syntax: [media img="https://via.placeholder.com/64x64.png"]<h5>List-based media object</h5>Cras sit amet ...
0 votes
1 answer
375 views
Images that copy code to clipboard when you click on them
I run a website about a programming language which is very well-integrated with a front-end which adds a lot of styling to the code that cannot be replicated in the browser. For that reason, I publish ...
1 vote
2 answers
3k views
How do I disable wpautop for a specific block?
I've registered a custom editor block with Advanced Custom Fields (ACF), and am using render_template with a PHP template partial to display the block contents. Inside the template is some HTML (...