Hello,
I apologize for the issue you are facing with disabling the breadcrumbs on your homepage. To disable the breadcrumbs specifically on the homepage, you can use a conditional statement in your theme’s functions.php
file instead of adding it to single.php
. Here’s how you can do it:
-
Access your theme’s functions.php
file: You can do this via the WordPress dashboard by navigating to Appearance → Theme File Editor and selecting your theme.
-
Add the following code:
function disable_breadcrumbs_on_homepage() {
if ( is_front_page() ) {
remove_action( 'rank_math_breadcrumbs', 'rank_math_the_breadcrumbs' );
}
}
add_action( 'wp', 'disable_breadcrumbs_on_homepage' );
This code checks if the current page is the homepage and removes the breadcrumbs if it is.
-
Save the changes: After adding the code, make sure to save the functions.php
file.
If you continue to experience issues, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further. Thank you for raising this concern!
Sources:
How to Make Your Theme Rank Math Compatible » Rank Math
Hello,
Please use this PHP code in your theme files instead to disable the breadcrumbs on your homepage:
/** Show Rank Math Breadcrumbs on all pages except the homepage **/
if ( function_exists('rank_math_the_breadcrumbs')
&& ( !is_home() && !is_front_page() ) ) {
rank_math_the_breadcrumbs();
}
Once done, clear your website’s cache and check again.
Looking forward to helping you.
it didn’t resolve it but I found a way with elementor
Hello,
Sorry for that. Glad to hear you found a solution using Elementor.
If you need any further assistance with Rank Math, feel free to reach out anytime.