World Wise News


Recommended


WordPress 3.9 How To Remove Copy Paste Font Style Attributes ‘Feature’

When you copy rich formatted text in Chrome, WordPress 3.9 now also adds the style attribute with font color and font style.

Wordpress Logo

To disable,

In your theme functions.php, add

add_filter('tiny_mce_before_init', 'disableStupidFeature');
function disableStupidFeature($init)
{
$init['paste_webkit_styles'] = '';
return $init;
}

Now when you copy and paste text into the TinyMCE editor, it will not have the style attribute but will still copy over bold, links and work just like WordPress 3.8


This entry was posted in oddities and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2011 - 2017 World Wise News.