Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Daniel-Walsh/724057ce4c073644c87f544f3e712c1b to your computer and use it in GitHub Desktop.
Save Daniel-Walsh/724057ce4c073644c87f544f3e712c1b to your computer and use it in GitHub Desktop.
Remove the current page from Yoast breadcrumbs #wordpress #php #seo
<?php
// Remove the current page from the Yoast breadcrumb trail, rendering the parent crumb in plain text.
add_filter(
'wpseo_breadcrumb_links',
function ( $links ) {
if ( sizeof( $links ) > 1 ) {
array_pop( $links );
}
return $links;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment