HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

How to Remove Auto Generated p Tags from Advanced Custom Fields

647 views November 15, 2019 0:46

Watch on YouTube
ChannelThe Designer Developer

Description from the creator

If you're using the wysiwyg editor with advanced custom fields, you will notice that when put inside a <p></p> tag, other <p></p> will automatically generate.

You can use this code to remove the autogenerated tags but then it becomes more difficult to edit within the editor.

function my_acf_add_local_field_groups() {
remove_filter('acf_the_content', 'wpautop' );
}
add_action('acf/init', 'my_acf_add_local_field_groups');

A better solution I found for this is to simply not wrap the_field(); of the wysiwyg editor in <p></p> because they're auto generated so you don't need to.

That way, you still have full control within the editor and within the page template.

If you have any questions, please let me know in the comments, otherwise, I hoped this helped you and thanks for watching.

Music credits: bensound.com

About this tutorial

The Designer Developer published this 0:46 video tutorial on November 15, 2019. It has been watched 647 times on YouTube.

Duration
0:46
Published
November 15, 2019
Views
647

Tags

Share

This tutorial in other languages