WordPress has some hooks if you want to remove some of the buttons or even adjust the Header tags.
Remove H1 Option
function yc_remove_h1_TinyMCE( $in ) {
$in['block_formats'] =
"Paragraph=p;
Heading 2=h2;
Heading 3=h3;
Heading 4=h4;
Heading 5=h5;
Heading 6=h6;
Preformatted=pre";
return $in;
}
add_filter( 'tiny_mce_before_init', 'yc_remove_h1_TinyMCE' );
You can just remove the other Header tags if you don’t need them and leave the paragraph tag!
Removes buttons from the first row
This is how you can remove the buttons from the first row of the tinyMCE editor.
add_filter( 'mce_buttons', 'yc_remove_tiny_mce_buttons_first_row');
function yc_remove_tiny_mce_buttons_first_row( $buttons ) {
$remove_buttons = array(
'bold',
'italic',
'strikethrough',
'bullist',
'numlist',
'blockquote',
'alignleft',
'aligncenter',
'alignright',
'link',
'unlink',
'wp_more', // read more link
'spellchecker',
'dfw', // distraction free writing mode
'wp_adv', // kitchen sink toggle (if removed, kitchen sink will always display)
);
foreach ( $buttons as $button_key => $button_value ) {
if ( in_array( $button_value, $remove_buttons ) ) {
unset( $buttons[ $button_key ] );
}
}
return $buttons;
}
Removes buttons from the second row
add_filter( 'mce_buttons_2', 'yc_remove_tiny_mce_buttons_second_row');
function yc_remove_tiny_mce_buttons_second_row( $buttons ) {
$remove_buttons = array(
'formatselect', // dropdown menu for p and header tags
'underline',
'alignjustify',
'forecolor', // text color
'pastetext', // paste as text
'removeformat', // clear formatting
'charmap', // special characters
'outdent',
'indent',
'undo',
'redo',
'wp_help', // keyboard shortcuts
);
foreach ( $buttons as $button_key => $button_value ) {
if ( in_array( $button_value, $remove_buttons ) ) {
unset( $buttons[ $button_key ] );
}
}
return $buttons;
}
More Resources
ACF advanced custom functions hook TinyMCE