2 ways to remove “Category” text from archive title in WordPress
There are 2 ways to remove “Category” text from archive title in WordPress – particularly in later themes such as Twenty Seventeen.
This is a common issue that people are facing with modern themes in 2017.
Rather than your archive / category title looking like this:
Category: Blue Widgets
It can look like this:
Blue Widgets.
Method 1:
- Open archive.php in your theme or child theme.
- Look for the following code (around line 20):
- the_archive_title( ‘<h1 class=”page-title”>’, ‘</h1>’ );
- Replace this with the following code:
- single_term_title(‘<h1 class=”page-title”>’, ‘</h1>’);
- Upload and overwrite archive.php
Method 2:
- Open archive.php in your theme or child theme.
- Look for the following code (around line 20):
- the_archive_title( ‘<h1 class=”page-title”>’, ‘</h1>’ );
- Replace this with the following code:
- echo ‘<h1 class=”page-title”>’;single_cat_title();echo ‘</h1>’;
- Upload and overwrite archive.php
Remember to always backup your files before making changes so that you can restore it if something goes wrong.