Remove Default WordPress Taxonomies

Remove category and tag taxonomies. Useful if you're not using the blog functionality of WordPress, including the taxonomies. Be sure to uncomment the other line if you're using Genesis to avoid errors.

<?php
/**
*
* Remove default taxonomies
*
* @link http://w4dev.com/wp/remove-taxonomy/
*
*/
add_action( 'init', 'unregister_taxonomy');
//remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); // uncomment this if you're using Genesis to avoid errors
function unregister_taxonomy(){
global $wp_taxonomies;
$taxonomies = array( 'category', 'post_tag' );
foreach( $taxonomies as $taxonomy ) {
if ( taxonomy_exists( $taxonomy) )
unset( $wp_taxonomies[$taxonomy]);
}
}

Source: https://gist.github.com/joshuadavidnelson/7443811

Tags: , , ,