Remove Category, Tag, Date, and Author Archives from WordPress

WordPress automatically generates a lot of archive pages. Sometimes those archive pages are useful. Sometimes they create duplicate or low-value content and add a lot of unnecessary URLs to the site. If those archives do not serve a specific purpose, removing them can be a reasonable SEO improvement.

The default archive pages WordPress generates

By default, WordPress creates the following archive pages:

  • Category archives
  • Tag archives
  • Author archives
  • Date archives
  • Post format archives, if the theme supports post formats
  • Search result archives

If you add custom post types and custom taxonomies, WordPress also generates:

  • Post type archives
  • Taxonomy term archives

Category archives

If the site does not really use categories to organize content, all posts end up in the default “Uncategorized” category. That produces an archive page like http://yourwebsite.com/category/uncategorized, and that page can easily end up being almost identical to the homepage or blog index, which creates duplicate content.

Of course, on some sites category archives are genuinely useful. When used well, they can be an important part of the site structure.

Tag archives

Many sites use large numbers of broad, generic tags. From an SEO perspective, those tags may add little value. Even so, tags can still be useful in the back end as a flexible way to connect related content. That means a site can keep using tags internally while hiding tag links and tag archive pages from the public side.

Author archives

If a site has multiple authors and wants a separate landing page for each author’s work, author archives are useful. But if the site only has one author, then author archives often become another form of duplicate content, much like category archives on a single-category site.

Date and post format archives

If the site is not updated frequently, date archives and post format archives often add very little value. In many cases, a search function is enough for users to find what they need.

How to remove unnecessary archive pages

The following code disables category, tag, date, and author archives. Just paste it into the theme’s functions.php file. If you want to keep one of those archive types, simply remove the related condition.

/* Remove unnecessary archive pages */
add_action('template_redirect', 'meks_remove_wp_archives');
function meks_remove_wp_archives(){
  // If we are on a category, tag, date, or author archive
  if( is_category() || is_tag() || is_date() || is_author() ) {
    global $wp_query;
    $wp_query->set_404(); // Set the request to a 404 page
  }
}

Instead of removing those archive pages entirely, another option is to keep them and mark them with a noindex tag. Personally, I prefer the simpler approach shown above. Fewer low-value pages means less clutter for users and fewer unnecessary URLs for search engines to consider.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *