How Can I Turn Off WordPress Taxonomy Archive Pages

How to turn off WordPress Taxonomy archive page

You can change WordPress Taxonomy to WordPress Private Taxonomy. When register a new taxonomy, need to set ‘rewrite’ as ‘false and ‘public’ as ‘false’

add_action( 'init', 'create_private_example_tax' );

function create_private_example_tax() {
    register_taxonomy(
        'example',
        'post',
        array(
            'label' => __( 'Example' ),
            'public' => false,
            'rewrite' => false,
            'hierarchical' => true,
        )
    );
}
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments