Remove Buttons from the Visual Editor

Unnecessary buttons in the Visual Editor? Try this

add_filter('mce_buttons', 'remove_mce_buttons' );
function remove_mce_buttons($buttons) {
	unset($buttons[16]);
	return $buttons;
}
//     [0] => bold
//     [1] => italic
//     [2] => strikethrough
//     [3] => |
//     [4] => bullist
//     [5] => numlist
//     [6] => blockquote
//     [7] => |
//     [8] => justifyleft
//     [9] => justifycenter
//     [10] => justifyright
//     [11] => |
//     [12] => link
//     [13] => unlink
//     [14] => wp_more
//     [15] => |
//     [16] => spellchecker
//     [17] => fullscreen
//     [18] => wp_adv

If you’re concerned about accidentally removing the wrong one, it’s simple enough to add a check

add_filter('mce_buttons', 'remove_mce_buttons' );
function remove_mce_buttons($buttons) {
	if ($buttons[16] == 'spellchecker')
	unset($buttons[16]);
	return $buttons;
}

Leave a Reply

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

%d bloggers like this: