0

In the WordPress admin panel, when switching between the "text" and "visual editor" tabs, my HTML formatting is completely lost. New lines are removed, and paragraph tags are shown in the "text" tab. When I select the "text" tab, and then refresh the page, the HTML remains formatted correctly. However, if I switch to the "Visual Editor" tab, and then back to the "text" tab, the formatting is incorrect (p tags are showing, new lines are not showing).

I'm also using the Classic Editor plugin. I also installed Advanced Editor Tools, hoping it would allow me to disable the functionality, but that hasn't worked either.

Using the same exact content, I tested this scenario on 2 of my other WordPress sites and do not have the same issue. Those sites also have the latest version of WordPress and the Classic Editor plugin installed.

I thought maybe wpautop had been disabled on the site, I went into functions.php and made sure that wpautop was not disabled anywhere in there. I even added this to the end of functions.php:

add_filter( 'the_content', 'wpautop');

I also tried disabling any plugins that I thought might be causing the issue. That didn't work either.

I've spent a few hours Googling and trying different things out. Any suggestions to help me debug this would be greatly appreciated.

1 Answer 1

1

I was finally able to get this fixed after some more debugging. I had previously disabled TinyMCE emojis which is what was causing the issue.

After removing this code from functions.php the editor started working as it normally does.

function disable_emojis() {
    add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
}
add_action( 'init', 'disable_emojis' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.