Category entire title into breadcrumb schema

#256502
  • Resolved Antonio
    Rank Math free

    Hi there.
    I’m not sure how to do.
    Is there’s a way to always keep into breadcrumb the title of the category?
    Example.
    Category: Product
    Child category: Product List
    Into the breadcrumb title I just add List, to avoid a repeat
    Home > Product > Product List
    so I get
    Home > Product > List
    But into breadcrumb in the source page, I have a non-sense
    {“@type”:”ListItem”,”position”:”3″,”item”:{“@id”:”https://www.example.com/product/product-list”,”name”:”List“}}]
    Is possible to keep into the breadcrumbs schema the complete title of the category instead of an abbreviation that I just use for users?
    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Nigel
    Rank Math business

    Hello,

    Thank you for contacting Rank Math about changing the title of a breadcrumb item.

    You would need to customise the code snippet below and paste it your theme’s fuctions.php file to change the breadcrumbs titles:

    
    /**
     * Allow changing or removing the Breadcrumb items
     *
     * @param array       $crumbs The crumbs array.
     * @param Breadcrumbs $this   Current breadcrumb object.
     */
    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    	return $crumbs;
    }, 10, 2);
    

    I hope that helps. If you have questions, ask away.

    Thank you for the quick reply.
    Sorry, I know this page with a lot of filters, but I can’t understand how to modify the title just for category.

    Example, I don’t know where add the code to customize function:

    **
     * Allow changing or removing the Breadcrumb items
     *
     * @param array       $crumbs The crumbs array.
     * @param Breadcrumbs $this   Current breadcrumb object.
     */
    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    >>>>>> E.G. if ( is_category( 'List' ) ) { just modify title breadcrumb...} <<<<<<<
    	return $crumbs; 
    }, 10, 2);
    Nigel
    Rank Math business

    Hello,

    I think I misunderstood your question. I am sorry for the incovenience.

    Please clarify, The category names are ‘Products’ and ‘Products List’. But when visitors visitor come to the website they see: Home > Products > List.

    Confirm, you want the schema to show the full name “Product List”

    How did you implement the current breadcrumb titles. A screencast, screenshots would be helpful. You can share code snippets if you have any.

    I look forward to helping you.

    Hi Nigel,
    sorry for trouble and thanks you for your time.
    I would have the entire title of category into schema markup breadcrumbs:
    E.G. ...position”:”3″,”item”:{“@id”:”https://www.example.com/product/product-list/,"name":”Product List Entire Category Title"}}
    and shorten as it is, for users:
    Home > Product > List

    Hello,

    The Schema markup should be an exact match of what you on the page to avoid manual penalties from Google.

    That’s why our plugin takes the information from the breadcrumbs that appear on your website and since the name, there appears as “List” that’s the word we take for the Schema.

    We don’t recommend changing this behavior because of what we mentioned and the possible penalties.

    Hope this helps clarify your doubts.

    Don’t hesitate to get in touch if you have any other questions.

    Thanks a lot, I didn’t consider it!
    I will find another solution.
    As always, thanks to all of you for your time.
    Great plugin!

    Hello,

    You’re welcome.

    We are glad that we have addressed your concern.

    If you have any other questions, please don’t hesitate to contact us anytime by creating a new ticket to assist you further with anything else.

    Looking forward to helping you.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)

The ticket ‘Category entire title into breadcrumb schema’ is closed to new replies.