Custom Wording for Archive Titles
Rewrites archive headings with your own wording, such as "Articles by Jane" on author pages or "Posts from March 2026" on monthly archives.
Opens WPIDE on
Code
// Title templates. %s is replaced with the term, author or date.
$wpide_archive_titles = array(
'category' => '%s',
'tag' => 'Posts tagged "%s"',
'author' => 'Articles by %s',
'year' => 'Posts from %s',
'month' => 'Posts from %s',
'day' => 'Posts from %s',
);
add_filter( 'get_the_archive_title', function ( $title ) use ( $wpide_archive_titles ) {
if ( is_category() ) {
return sprintf( $wpide_archive_titles['category'], single_cat_title( '', false ) );
}
if ( is_tag() ) {
return sprintf( $wpide_archive_titles['tag'], single_tag_title( '', false ) );
}
if ( is_author() ) {
return sprintf( $wpide_archive_titles['author'], get_the_author_meta( 'display_name', get_queried_object_id() ) );
}
if ( is_day() ) {
return sprintf( $wpide_archive_titles['day'], get_the_date() );
}
if ( is_month() ) {
return sprintf( $wpide_archive_titles['month'], get_the_date( 'F Y' ) );
}
if ( is_year() ) {
return sprintf( $wpide_archive_titles['year'], get_the_date( 'Y' ) );
}
return $title;
}, 20 );
Notes
Edit the templates at the top; %s is replaced with the name or date.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.