Home Forums General Issues Remove p tag in WYSIWYG editor


Remove p tag in WYSIWYG editor

  • How to hide p tag in editor? When I load an images into the editor it places a p tag around the image, how can I remove this?

  • Hi @bigbankclub

    The p tag is automatically created when you inserted a new line. If you want to remove it on the front end, you can try the following code:

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

    I hope this helps.

  • I placed the code into the funtions.php file and did not change anything, unless I’m missing something.

  • Hi @bigbankclub

    That code won’t change anything on the backend, but it will remove the <p> tag on the front end when you use the get_field() or the_field() functions.

    I hope this clears things up. Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Remove p tag in WYSIWYG editor’ is closed to new replies.