Skip Navigation

[Resolved] Split: Remove the word “Archive” from Archive page titles

This thread is resolved. Here is a description of the problem and solution.

Problem:

Remove the word "Archive" from Archive page titles.

Solution:

In most theme, it is using wordpress function the_archive_title() to output the archive title, so you can use filter hook gettext to change the archive title as what you want, for example

https://toolset.com/forums/topic/split-remove-the-word-archive-from-archive-page-titles/#post-1091161

Relevant Documentation:

https://developer.wordpress.org/reference/hooks/gettext/

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by liatG 3 years, 10 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#1091058

I'm using Toolset with Astra Pro. On my custom post types Archives pages, the page header has the word "Archives:" and I'm trying to get rid of it. Can you help me do so?
When I go to the theme option on my custom Layouts and select "Archive Title" -> disable, nothing happens. The word "Archives:" persists.
Here's an example: hidden link
Thanks for any help!

/// This seemed solved here:
/// https://toolset.com/forums/topic/remove-the-word-archive-from-archive-page-titles/#post-952768
/// https://toolset.com/forums/topic/remove-the-word-archive-from-archive-page-titles/#post-958290

FOLLOW UP:
Please disregard my last answer. I didn't know what I was talking about.
I am definitely having a problem with this - I did the same thing you did and I still have the word "Archives:.." on every archive page.

I tried but was unable to upload a copy of my site with Duplicator as per your instructions.
However I did make you an admin login to my site. Can you still help?

#1091161

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

In most theme, it is using wordpress function the_archive_title() to output the archive title, so you can use filter hook gettext to change the archive title as what you want, for example, add below codes into your theme file "functions.php":

add_filter('gettext', function($translated_text, $untranslated_text, $domain){
	if($untranslated_text == "Archives: %s" && $domain == 'default'){
		$translated_text = '%s';
	}
	return $translated_text;
}, 20, 3);

More help:
https://developer.wordpress.org/reference/hooks/gettext/

#1093138

Thank you! This worked.