change title of page in breadcrumb
-
Hi
I want to change the title of main page in rankmath breadcrumb
How can I achieve that?
-
Hello @raha1988ab,
Thank you for contacting Rank Math support.
You can set a custom Breadcrumbd title for each page in the Advanced Tab of our plugin’s meta box: https://rankmath.com/kb/advanced-tab/#breadcrumb-title
If you want to change the title of the Homepage, please navigate to WP Dashboard > Rank Math SEO > General Settings > Breadcrumbs and set the titel you want in the Homepage Label.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
I read that link before
I need custom code!
We change many thing to add dynamic query like brands in attributes
now it will show on the front-end,
we need to change the breadcrumb in this section and with rank math shortcode or every code you crate before we can not achieve what we want
It should and it must have the option to change the title generated on the page, from category or dynamic attributes
I need to customize current page’s label (title) in breadcrumb.
As you know, currently the breadcrumb will get current page main title, but I need to add some extra strings to it. So if there is any hook or code to modify it, I will be appreciated if you share with me.- This reply was modified 12 months ago by raha1988ab.
Hello @raha1988ab,
If you need further specific modifications in your breadcrumbs, we do have a filter code for that. Here’s an example on how to do so:
add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) { global $post; if ($post->ID == 98) { $crumbs[1][0] = 'New Title'; // Title of the Breadcrumb $crumbs[1][1] = 'https://EXAMPLE.COM/some-page/'; // URL of CPT slug } return $crumbs; }, 10, 2);
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.HI
We update that code
// Modify Rank Math breadcrumbs to include filter parameters add_filter('rank_math/snippet/breadcrumb', 'custom_modify_rank_math_breadcrumb'); function custom_modify_rank_math_breadcrumb($crumbs) { $filters = array(); if (isset($_GET['filter_color'])) { $filters[] = 'Color: ' . $_GET['filter_color']; } if (isset($_GET['filter_brand'])) { $filters[] = 'Brand: ' . $_GET['filter_brand']; } if (isset($_GET['filter_size'])) { $filters[] = 'Size: ' . $_GET['filter_size']; } if (!empty($filters)) { $breadcrumb = ''; foreach ($crumbs as $crumb) { if (is_array($crumb)) { $breadcrumb .= '' . esc_html($crumb['name']) . ''; $breadcrumb .= ' / '; } } $breadcrumb .= '' . implode(' / ', $filters) . ''; $crumbs[] = array( 'name' => 'Filters', 'url' => '', 'type' => 'breadcrumb', 'children' => array(), 'html' => $breadcrumb, ); } return $crumbs; }
now there is an issue, in the source of pages, it just put the schema, not the breadcrumb html tag, and in Google Reach result test shows that
could you please help me in this to solve that issue?
Many Thanks
Hello @raha1988ab,
The filter hook “rank_math/snippet/breadcrumb” will only modify the schema, not the breadcrumbs item we generate in the HTML.
You can make use of this filter hook instead as this will both change the HTML and the scheme respectively: https://rankmath.com/kb/filters-hooks-api-developer/#change-remove-breadcrumb-items
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Could you please see this image and confirm that is it okey based on seo or not?
Hello @raha1988ab,
The properties in the Schema are incorrect. Please use the filter we shared before to modify the breadcrumb title in the front end. The same will be updated in the Schema with the correct properties. The filter you are currently using is modifying the breadcrumbs Schema.
Please do not hesitate to let us know if you need our assistance with anything else.
- The topic ‘change title of page in breadcrumb’ is closed to new replies.