Skip to content

Instantly share code, notes, and snippets.

@nathaningram
Created October 17, 2024 18:11
Show Gist options
  • Select an option

  • Save nathaningram/5e9ab12b59d60a594ae326849fc8790a to your computer and use it in GitHub Desktop.

Select an option

Save nathaningram/5e9ab12b59d60a594ae326849fc8790a to your computer and use it in GitHub Desktop.
No Mo Tags
// This is not fully tested :)
function bww_disable_tags_support() {
// Unregister tags from posts
unregister_taxonomy_for_object_type('post_tag', 'post');
// Remove tags from post types (including custom post types)
foreach (get_post_types() as $post_type) {
unregister_taxonomy_for_object_type('post_tag', $post_type);
}
}
add_action('init', 'bww_disable_tags_support');
// Remove tags from admin menus
function bww_remove_tags_admin_menu() {
remove_menu_page('edit-tags.php?taxonomy=post_tag');
}
add_action('admin_menu', 'bww_remove_tags_admin_menu');
// Remove tags from quick edit
function bww_remove_quick_edit_tags($actions) {
if (isset($actions['inline hide-if-no-js'])) {
unset($actions['inline hide-if-no-js']);
}
return $actions;
}
add_filter('post_row_actions', 'bww_remove_quick_edit_tags', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment