fbpx

WordPress, How to remove the glossary plugin meta box from the post editing panel

Glossary, is a plugin that allows you to create a glossary of terms. It’s quite complete software and also allows you to create external and internal links to the site without having to create an article. This plugin, creates a metabox in the section dedicated to editing articles (backoffice post wordpress). Someone may need to remove this metabox for certain reasons.

Simply enter the following code at the end of function.php.

if (!current_user_can('edit_pages')){
add_action('add_meta_boxes','my_remove_glossary_post_metabox',100000);
}
function my_remove_glossary_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 suggest you create a child theme where you can insert this code.

Avoid using the standard removal system below or you’ll have problems.

function remove_my_post_metabosex(){
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 tried this change with the 1.4.11 plugin version. Before editing, make sure you make a backup, make sure you know what you’re doing well, and make sure that function names don’t conflict with other names already in your code.

Use this article if you know what you’re doing I don’t take any responsibility. You can share the content of this article by creating a direct link without a “no follow” attribute to this page.


Responses

Your email address will not be published.