Remove specific pages from all breadcrumbs
-
Hello there! We have two parent pages, which shouldn’t appear on breadcrumbs at all (on all subpages of those parents, this parent page shouldn’t appear), shouldn’t be indexed and should redirect to home page if accessed somehow. I managed to do the last two things (as well as remove them from sitemap), but I’m still struggling with breadcrumbs. I’ve tried two code snippets I’ve found on this forum, but they don’t work for me:
add_filter( 'rank_math/frontend/breadcrumb/items', function( $items ) { if ( is_page(2270) || is_page(313) ) { return []; } return $items; } ); add_filter('rank_math/snippet/breadcrumb', function ($entity) { if (is_page(2270) || is_page(313)) { return []; } return $entity; });
Any suggestion on how to remove specific pages completely from the breadcrumbs?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Remove specific pages from all breadcrumbs’ is closed to new replies.