Skip to content

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

Summary

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.

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

Some links on Gold Penguin are affiliate links. If you buy through them we may earn a commission, at no extra cost to you. How we make money

Subscribe
Notify of
guest

0 Comments
Most Voted
Newest Oldest

Related reviews

More like this

Get new reviews by email

One email a month: new reviews, price changes and the benchmark. Unsubscribe any time.