• I’m sorry, I speak a little English.

    Installed:

    Classic Editor 1.6.2 plugin (WordPress 5.8.1)

    If I click from “Text” to “Visual” tab, then back to “Text”, removed the <br/> tags. I need these <br/> tags.

    Screenshots:

    1. Text: https://i.imgur.com/VYizddC.png

    2. Visual: https://i.imgur.com/lgROXGQ.png

    3. Text: https://i.imgur.com/CtSHndf.png

    (removed the <br/> tags)

    The plugin settings wp-admin page:

    View post on imgur.com

    I try, but does not work:

    ~/wp-content/themes/mytheme/functions.php

    remove_filter( 'the_content', 'wpautop' );
    
    function uncoverwp_tiny_mce_fix( $init ) {
    
        $init [ 'remove_linebreaks' ] = false;
        $init [ 'convert_newlines_to_brs' ] = true;
        $init [ 'remove_redundant_brs' ] = false;
    
        return $init;
    
    }
    
    add_filter( 'tiny_mce_before_init', 'uncoverwp_tiny_mce_fix' );

    What is the solution?

    Thanks.

The topic ‘WordPress TinyMCE editor delete BR tags’ is closed to new replies.