[Support request] Removing “archives” from Categories page titles

Home Forums Support [Support request] Removing “archives” from Categories page titles

Home Forums Support Removing “archives” from Categories page titles

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1327879
    Marc

    Hey there, I have a couple of category pages on my site that I link to from the menu, one example is https://www.blindluminations.com/podcast/

    As you can see, the word “archives” is in the page title but not in the header. How do I remove the word “archives” from category pages like these? I’ve seen posts about the get_archive_title filter but I’m not knowledgeable enough to know if it’s relevant in this case… or how to customize it for my use if so.

    I generally use the code snippets plugin recommended by Tom or hooks from GP Premium to implement code. Any instructions using those methods would be hugely appreciated.

    Thanks in advance for any help you can offer!

    #1328423
    David
    Staff
    Customer Support

    Hi there,

    how did you add the link in the menu ? As you should be able to edit the Label

    #1664017
    Jaakko Pöntinen

    Hiya.

    This was such an annoying thing to find out; I’ll paste the solution that works for most cases (it did for me) and the link to where I got it from.

    // Simply remove anything that looks like an archive title prefix ("Archive:", "Foo:", "Bar:").
    add_filter('get_the_archive_title', function ($title) {
        return preg_replace('/^\w+: /', '', $title);
    });

    Link: https://wordpress.stackexchange.com/questions/175884/how-to-customize-the-archive-title/175900

    #1664185
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.