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.
Justin Gluska
Updated May 4, 2023
Reading Time: 2 minutes
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.
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; }
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
:
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):
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 newsletter where we share tips & tricks on how to use tech & AI to grow and optimize your business, career, and life.