Change TinyMCE Editor Class

The code below will change TinyMCE’s default class, useful for styling the post editor to look like the front end of your site. This function goes into your theme’s functions.php file.

function change_editor_body_class($init){
$init[‘body_class’] = ‘my_class’;
return $init;

add_filter(‘tiny_mce_before_init’, ‘change_editor_body_class’);

If you enjoyed this post, make sure to subscribe to WPMayor’s RSS feed.

About Jean Galea

Jean Galea is a WordPress developer, entrepreneur and padel player. He is the founder of WP Mayor, the plugins WP RSS Aggregator and EDD Bookings, as well as the podcast. His personal blog can be found at

Related Articles

Leave a Reply