Gold Penguin Logo with Text

Remove "Category:" and "Tags:" Archive Page Inserts in Oxygen Builder

Are you tired of the "Category:" and "Tags:" prefix in Oxygen dynamic archive pages? You can easily remove it by installing a PHP code snippet and calling a specific function. With the help of a code snippets plugin, you can achieve a cleaner look for your category, tag, or custom archive titles in Oxygen.
Updated May 16, 2023

If you're trying to remove the "Category: " and "Tags: " prefix that comes when trying to create dynamic achieve pages in Oxygen, you're not alone.

To get rid of this, you can install a php code snippet and then call that function to remove the prefix. Here's how:

Removing Category Archive Insert in Oxygen Builder

If you're tired of seeing the name in front of your category/tag/custom archive you can easily get rid of it.

Archive prefix with and without the prefix in Oxygen builder.

You'll need a code snippets plugin to do this. I like the Code Snippets one since it's super easy to integrate. One you add the plugin, add a new php snippet and paste the following code:

add_filter( 'get_the_archive_title', 'my_theme_archive_title' );
/**
 * Remove archive labels.
 * 
 * @param  string $title Current archive title to be displayed.
 * @return string        Modified archive title to be displayed.
 */
function my_theme_archive_title( $title ) {
    if ( is_category() ) {
        $title = single_cat_title( '', false );
    } elseif ( is_tag() ) {
        $title = single_tag_title( '', false );
    } elseif ( is_author() ) {
        $title = '<span class="vcard">' . get_the_author() . '</span>';
    } elseif ( is_post_type_archive() ) {
        $title = post_type_archive_title( '', false );
    } elseif ( is_tax() ) {
        $title = single_term_title( '', false );
    }

    return $title;
}
Archive prefix Oxygen builder function to truncate the category or tag titles

Once you're done, instead of using the archive title dynamic data you'll just use a php function call and replace it with the name of the code snippet: get_the_archive_title:

Insert custom PHP function return value in Oxygen Builder

That's it! You won't have the prefix anymore. You should see the name itself (I added the word blogs after just because I wanted to):

Final removed archive category text showing just the category name in Oxygen builder

Hope this helped! Drop a comment if you have any questions

Want To Learn Even More?
If you enjoyed this article, subscribe to our free monthly newsletter
where we share tips & tricks on how to use tech & AI to grow and optimize your business, career, and life.
Written by Justin Gluska
Justin is the founder of Gold Penguin, a business technology blog that helps people start, grow, and scale their business using AI. The world is changing and he believes it's best to make use of the new technology that is starting to change the world. If it can help you make more money or save you time, he'll write about it!
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
Join Our Newsletter!
If you enjoyed this article, subscribe to our newsletter where we share tips & tricks on how to make use of some incredible AI tools that you can use to grow and optimize a business
magnifiercross