You may need to hide a metabox. Surely the intention of the programmer when inserting a metabox is, in many cases but not all, to improve the service.
Not all webmasters appreciate the fact that simple users can control site features even for security reasons. From my point of view all addons should give the opportunity to choose โfor freeโ what elements make visible to simple users.
Whatever the motivation, Iโll now explain how to remove the metabox of the super socialzer plugin that is located within the editing panel of articles.
In the functions.php file of your theme, you must enter the following code:
if (!current_user_can('edit_pages')){
add_action('add_meta_boxes','my_remove_super_socializer',100000);
}
function my_remove_super_socializer_post_metabox(){
remove_meta_box('glossary_post_metabox','post','normal');
}
add_action('admin_menu','wpdocs_remove_post_custom_fields');
if(is_admin()){
add_action('admin_menu','wpdocs_remove_meta_boxes');
}
I recommend creating a child theme because otherwise, if you update the theme you will lose the change
Avoid using the following standard code because it will give you problems:
function remove_my_post_metaboxes(){
remove_meta_box('authordiv','post','normal');
remove_meta_box('commentstatusdiv','post','normal');
remove_meta_box('commentsdiv','post','normal');
remove_meta_box('postcustom','post','normal');
remove_meta_box('postexcerpt','post','normal');
remove_meta_box('revisionsdiv','post','normal');
remove_meta_box('slugdiv','post','normal');
remove_meta_box('trackbacksdiv','post','normal');
remove_meta_box('related_post_metabox','post','high');
}
add_action('admin_menu','remove_my_post_metaboxes');
I tested this change with version 7.9.4 of the plugin. Before you almost change what you make sure you have a backup and know what youโre doing.