404 Error On Category and Tags Pages

I know this is an old question but I was having the same issue in a theme I inherited and came across this question in my search for answers.

In my particular case, I found the following PHP code included in the theme’s function.php file:

if( is_category() || is_date() || is_author() ) {
   global $wp_query;
   $wp_query->set_404(); //set to 404 not found page
}

This code redirects any category, date, or author archive page to a 404 error (which brings up your 404 theme template). You may want to search for something similar in your theme (assuming you haven’t already figured this out).

Leave a Comment