// Remove post title from Yoast breadcrumbs
add_filter('wpseo_breadcrumb_single_link', function( $link_output) {
if( strpos( $link_output, 'breadcrumb_last' ) !== false ) {
$link_output = '';
}
return $link_output;
} );
// Remove post title from Yoast breadcrumbs
add_filter('wpseo_breadcrumb_single_link', function( $link_output) {
if( strpos( $link_output, 'breadcrumb_last' ) !== false ) {
$link_output = '';
}
return $link_output;
} );
Handy snippet for removing the current post title from the end of Yoast breadcrumbs. It filters wpseo_breadcrumb_single_link and clears the output for the breadcrumb_last item, so only the parent trail remains. Useful when the page title is already shown as the heading right below.
ReportEnter to see all results · Esc to close