Hide the Access button in WordPress editors

Originally written
June 26, 2020
Updated
June 26, 2020

Access plugin allows you to disable the Access button in WordPress TinyMCE editors.

Hide the Access button in WordPress editors for specific user roles

To do this we add a callback to the toolset_editor_access_button_disable_by_role filter and define for which specific user roles should the Access button be hidden. Here is an example code you can use in your theme’s functions.php file:

Disable Access Button
add_filter('toolset_editor_access_button_disable_by_role','wpcf_hide_access_button');
function wpcf_hide_access_button( $roles=array() ){
return array('author', 'subscriber');
}

We used the wpcf_hide_access_button callback function to return an array of roles that will not get the ability to see the Access button, in our case author and subscriber.

Hide the Access button in WordPress editors globally

If you want to hide Access button in WordPress TinyMCE across your whole website you can use filter toolset_editor_add_access_button. Here is an example code you can use in your theme’s functions.php file:

Hide the Access button globally
add_filter( 'toolset_editor_add_access_button', '__return_false' );