How to redirect unnecessary straints in Wordpress?

Plan to use standard taxonomy only for official categorization of the content - ie, for the administrator, and structured to output the posts of a certain category on certain pages. But I don't want that the user was able to view the page headings/categories, which by default is in any subject.

How to configure WordPress to not show the user this content is generally the standard theme templates, and to avoid problems with SEO? Is it possible to forward all queries for the category to the page with the same name, for example? What kind of redirect in this case to use?
April 4th 20 at 00:40
2 answers
April 4th 20 at 00:42
All final decisions on what to show the user, WP takes on the template_redirect hook. By setting this condition, we can for example give 404 error on all categories:
add_action( 'template_redirect', 'all_categories_not_found' );
all_categories_not_found function() {
 if ( is_category()) {
 global $wp_query;
$wp_query->set_404();
 status_header( 404 );
 require get_404_template();
die();
}
}
April 4th 20 at 00:44

Find more questions by tags WordPress