Alter taxonomies arguments using a filter register_taxonomy_args
WordPress has a built in taxonomy argument filter register_taxonomy_args that allows you to alter the taxonomy options.
For instance all EPL taxonomies pages are public by default where WordPress will automatically generate your slugs and display listings e.g:
/suburb/suburb-name/
If you want to disable this then you can use the following filter.
/**
* Disable location taxonomy public
*
*/
function my_disable_public_location_tax( $args, $taxonomy ) {
// Target "my-taxonomy"
if ( 'location' !== $taxonomy ) {
return $args;
}
// Set Hierarchical
$args['public'] = false;
// Return
return $args;
}
add_filter( 'register_taxonomy_args', 'my_disable_public_location_tax', 10, 2 );