Remove “Category:” text in archive page title

<h1>
  <?php echo single_cat_title( '', false );?>
</h1>

The result will be just Category name

Default is: Category: Category name

If you want to change “Category:” use this:

<h1>
  <?php echo single_cat_title( 'Some text: ', false );?>
</h1>

Thanks, Hammad Wali for sharing this useful code!

// newsletter

Three tested WordPress snippets a week

Blocks, security, performance, Tailwind, PHP and React. Copy, paste, ship. You’ll also get DPlugins product updates. No spam, and you can unsubscribe anytime.

// newsletter

Three tested WordPress snippets a week

Blocks, security, performance, Tailwind, PHP and React. Copy, paste, ship. You'll also get DPlugins product updates. No spam, and you can unsubscribe anytime.

Click to Copy