If you just want to "turn off" the public facing part of a taxonomy (eg. just use it for grouping), you can do that when you register it.
Just set the query_var
argument to false
and WordPress will not recognize taxonomy page requests and simply 404. This will work if you don't have pretty permalinks enabled.
<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
register_taxonomy('your_taxonomy', 'your_post_type', array(
// other stuff here...
'query_var' => false,
));
}
You can also disable pretty permalinks by setting the rewrite
argument to false (props ottootto).
<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
register_taxonomy('your_taxonomy', 'your_post_type', array(
// other stuff here...
'rewrite' => false,
'query_var' => false,
));
}
If you do need to allow logged in users to view the taxonomy pages (can't tell from the question), that's different story.