Skip to content

Instantly share code, notes, and snippets.

@Daniel-Walsh
Last active October 1, 2021 02:28
Show Gist options
  • Save Daniel-Walsh/f3f192f5803d498f109aae6314fe82c1 to your computer and use it in GitHub Desktop.
Save Daniel-Walsh/f3f192f5803d498f109aae6314fe82c1 to your computer and use it in GitHub Desktop.
Deregister the WordPress core 'category' and/or 'tag' taxonomy from the core 'post' post type #wordpress #php
<?php
// Deregister the 'category' taxonomy from the default 'post' post type.
add_action(
'init',
function () {
unregister_taxonomy_for_object_type( 'category', 'post' );
}
);
<?php
// Deregister the 'tag' taxonomy from the default 'post' post type.
add_action(
'init',
function () {
unregister_taxonomy_for_object_type( 'post_tag', 'post' );
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment