How to remove the super socializer plugin meta box from the post editing panel

Sometimes, you may need to hide or delete a metabox. Of course, the intention of the programmer, by inserting the metabox, in most cases is to provide better service.

Not all webmasters, however, appreciate the fact that their users’ interface is dirty by these metaboxes. Others may need to hide some features to the user, either for security reasons or because they have set a predetermined format for your site.

Whatever the motivation, I now explain how to delete the metabox of the super socializer plugin inside the post editing panel.

In your functions.php, you have to add this lines

//hide super socializer
if ( ! current_user_can( 'edit_pages' ) ) {
add_action( 'add_meta_boxes', 'my_remove_the_champ_meta_box', 100000 );
}
function my_remove_the_champ_meta_box(){
remove_meta_box( 'the_champ_meta', 'post', 'normal' );
}
add_action( 'admin_menu' , 'wpdocs_remove_post_custom_fields' );
if ( is_admin() ) {
add_action( 'admin_menu', 'wpdocs_remove_meta_boxes' );
}

I suggest you create a child theme where to put this code. Any subsequent updates may overwrite the code.

The format I used also serves to remove other features in the posts section, I’ve written other articles that talk about it.

Avoid using the standard system with such a code or there will be problems:

function remove_my_post_metaboxes() {
remove_meta_box( 'authordiv','post','normal' ); // Author Metabox
remove_meta_box( 'commentstatusdiv','post','normal' ); // Comments Status Metabox
remove_meta_box( 'commentsdiv','post','normal' ); // Comments Metabox
remove_meta_box( 'postcustom','post','normal' ); // Custom Fields Metabox
remove_meta_box( 'postexcerpt','post','normal' ); // Excerpt Metabox
remove_meta_box( 'revisionsdiv','post','normal' ); // Revisions Metabox
remove_meta_box( 'slugdiv','post','normal' ); // Slug Metabox
remove_meta_box( 'trackbacksdiv','post','normal' ); // Trackback Metabox
remove_meta_box( 'related_post_metabox','post','high' ); // Trackback Metabox
}
add_action('admin_menu','remove_my_post_metaboxes');

I tested this change with the 7.9.4 plugin version. Before editing Make sure you make a backup, make sure you know what you are doing well and make sure the function names do not conflict with other names already in the code.

Rispondi