Customize breadcrumb categories links

#35128
  • Resolved juan gomar
    Rank Math free

    Hey, guys, thanks for this fantastic plugin.

    Is there any way to change the links from the breadcrumb categories?

    What I want to do is have them link to a custom page that works as a category, instead of linking to wordpress file pages.

    Thanks!!

    • This topic was modified 4 years, 8 months ago by juan gomar.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Thank you for contacting Rank Math today.

    This option is only possible with custom code. I can suggest that you take a look at the following filter that might help in this:

    /**
     * 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);

    Looking forward to helping you. Thank you.

    ​​​​​​

    Thank you for responding,

    Seems a bit difficult, I don’t know much about custom code.

    Hi there,

    Thanks for the follow up.

    Could you please share an example link that you would like to modify the breadcrumbs for and the URL of the page that you would like to redirect to so that I can test and share some code that you can try on your end?

    Please share this info on the sensitive data section.

    Thank you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Todd
    Rank Math free

    Hi Juan,

    The easiest way to attain this without any coding is by creating a redirect from
    /category/mercadona/
    to
    /mercadona/

    You can do that from WordPress Dashboard > Rank Math > Redirections > Add New

    This will redirect all users from the source URL to the target URL and thus attaining what you want without any issue.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Okay, I think that’ll be fine, thanks.

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘Customize breadcrumb categories links’ is closed to new replies.