This is a very quick guide that will explain how you can set the ‘Paste as text’ option to be active by default in the WordPress visual editor to prevent styles from being pasted into your content editor and ruining your layouts.
1. Using Plugin
Enable paste as text by default with one click in editors like Classic Editor, Divi, Elementor, Beaver Builder, WPBakery, and WPUF (but not in Gutenberg).
No more unwanted formatting issues or junk code when copying and pasting text into your WordPress editor. Paste content from pdf documents, emails, or other websites without importing colors and font stylings that don’t match your overall design.
2. Using Coding (The function)
I’ll cut right to the point, here is the function you will need to use to force the ‘Paste as text’ option to be active by default in the WordPress visual editor.
/* * Paste as plain text Default */ function wphelper_paste_as_text( $init ) { $init['paste_as_text'] = true; return $init; } add_filter('tiny_mce_before_init', 'wphelper_paste_as_text');
You can place the function above in your theme functions.php file or an MU plugin which would be a better option, this will now force the ‘Paste as text’ option to be on unless clicked in the visual editor. No longer will you accidentally paste formatted text into WordPress or have to worry about your clients doing so.
If you get stuck with adding this function to your site please leave a comment below or contact us.
For more information on ‘Paste as text’ by default in WordPress visual editor, let us help you accordingly, from start to finish, with one-Time fixes, custom plans, or monthly routines for your WordPress website.