Wordpress: disable tags for posts only

I am currently developing a theme for Wordpress 3.8.1. Since tags are not displayed in my topic, so I want to disable them (only from messages, and not from custom message types). But how do I do this? I tried this, but apparently does nothing:

register_taxonomy('post_tag', null);

To be clear: I do not just want to hide tags in template files, but I want to completely disable them, so there are no menu items for tags in messages in the backend.

Is it possible? I hope so. Thank you for your help!

Update

In addition, I tried the following, without any effect:

register_taxonomy('post_tag', array());

and

global $wp_taxonomies;
$taxonomy = 'post_tag';
if(taxonomy_exists($taxonomy))
    unset($wp_taxonomies[$taxonomy]);

Both delete the tag field when editing the message, but there is still a link in the menu pointing to the tag list!

+4
2

WordPress 3.7 unregister_taxonomy_for_object_type, .

:

// Remove tags support from posts
function myprefix_unregister_tags() {
    unregister_taxonomy_for_object_type('post_tag', 'post');
}
add_action('init', 'myprefix_unregister_tags');

.

+12

. php

add_action( 'admin_menu', 'myprefix_remove_meta_box');
function myprefix_remove_meta_box(){
   remove_meta_box( 'tagsdiv-post_tag','post','normal' );
}

tags meta box tagsdiv-post_tag, - tags

add_action('init', 'remove_tags');
function remove_tags(){
    register_taxonomy('post_tag', array());
}

+6

Source: https://habr.com/ru/post/1533757/


All Articles