Sometimes you have a client that really thinks they are a designer, and reeeaaalllly wants everything to be pink. Or centered, justified, bold, etc. Did I already mention pink? On some occasions it’s better for the client, and their business/blog, if they didn’t have the ability to do that stuff.
I’m currently rebuilding a site for a new client that wants everything pink. Everything. Seriously. I decided it may be worth disabling the font color option from the TinyMCE editor in WordPress. I googled a bit and found Tom McFarlin’s post, which got me halfway there. But his filter only removes items from the kitchen sink. I wanted to remove buttons from the main row of the editor too.
Tom’s code uses the mce_buttons_2 filter. I figured the “_2” meant it was filtering the “second row”, so I googled a bit and found a slew of filters for the WP editor.
I dumped all the data, and found what I was looking for. Here is a snippet to optionally remove buttons from both rows of the WordPress TinyMCE editor. Please note, this removes ALL the buttons, so only remove the ones you’d like.
Chris Pink says
Simple, useful, works. Thank you
I too see no need to give the client a font colour button. (How about a Comic Sans button instead?)
BOLA OSSU says
hi
Very useful .
is there another way doing this , making by default all button hidden, and then only allow specified button in function.
Why ? because i am thinking of the case where the user(client) may have possibility to install plugin that automatically add button …
will those new button be displayed or hidden
Thanks
Bekah says
Thanks for sharing this, Mike! I’ve been trying for a while now to get control of the TinyMCE toolbar and this was by far the clearest explanation I’ve found.
Ted says
I found your code at github and just stopping by to say… Thank You! I’m using on a multisite network and it works great. I started by commenting out all the buttons in the code, then simply uncomment the buttons I want to remove. In this way I can limit what buttons bloggers have access to across the network. Simple and effective.
Ink says
thanks a lot , very useful!
JB
Jenni says
This was exactly what I was in need of. Thanks a bunch Sir.
Ralf says
Hi, thanks for this! Ist there a complete list of codes somewhere? Specifically, I’m looking for font size and family …
JiveDig says
I’m not sure if those are built in. Also, with the new block editor in WP 5.0, I’m not sure this is as relevant anymore.
Phoenix Kiula says
The “formatselect” seems to be in the first row now, and if I remove it, it seems to not work. Any ideas? Using WP 5.3.