Categories
Blog Code Snippets Wordpress

Remove the word “Archives” from the Archive Page Title

Add this to functions.php

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function grd_custom_archive_title( $title ) {
// Remove any HTML, words, digits, and spaces before the title.
return preg_replace( '#^[\w\d\s]+:\s*#', '', strip_tags( $title ) );
}
add_filter( 'get_the_archive_title', 'grd_custom_archive_title' );
function grd_custom_archive_title( $title ) { // Remove any HTML, words, digits, and spaces before the title. return preg_replace( '#^[\w\d\s]+:\s*#', '', strip_tags( $title ) ); } add_filter( 'get_the_archive_title', 'grd_custom_archive_title' );
function grd_custom_archive_title( $title ) {
// Remove any HTML, words, digits, and spaces before the title.
return preg_replace( '#^[\w\d\s]+:\s*#', '', strip_tags( $title ) );
}
add_filter( 'get_the_archive_title', 'grd_custom_archive_title' );

Or use:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function override_page_title() {
return false;
}
add_filter('woocommerce_show_page_title', 'override_page_title');
function override_page_title() { return false; } add_filter('woocommerce_show_page_title', 'override_page_title');
function override_page_title() {
return false;
}
add_filter('woocommerce_show_page_title', 'override_page_title');

 

Leave a Reply