Theme & Front End PHP Beginner

Remove “Category:” From Archive Titles

Show "News" instead of "Category: News" at the top of category, tag and other archive pages.

Tested on WordPress 7.1 PHP 8.3 No plugin needed Updated
functions.php 1 lines
add_filter( 'get_the_archive_title_prefix', '__return_empty_string' );

Where to add this

Recommended A code snippets plugin Survives theme changes and is easy to switch off.
Child theme At the end of your child theme's functions.php file.
Must-use plugin As a .php file in wp-content/mu-plugins, starting with <?php.

Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.

WordPress adds a prefix like “Category:”, “Tag:” or “Archives:” to archive page titles. Most designs don’t want it. This one line removes it everywhere.

How it works

Since WordPress 5.5, the prefix is passed through get_the_archive_title_prefix before being added to the title. Returning an empty string leaves just the category, tag or post type name. It works for themes that use the_archive_title() and for the Query Title block.

Things to watch

  • Themes that build their own archive titles don’t use this filter. Check your theme’s settings if the prefix remains.

How to test it

Open any category page. The heading should show only the category name.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only