how to remove h2 formatting option from the wordpress classic editor

Below is the code to remove h2 option from wordpress classic editor

function remove_h2_from_editor( $settings ) {
$settings['block_formats'] = 'Paragraph=p;Heading 1=h1;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre;';
return $settings;
}
add_filter( 'tiny_mce_before_init', 'remove_h2_from_editor' );

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.