search ]

Add a Link to Yoast SEO Breadcrumbs

Say you want to add a link to the blog in the Yoast breadcrumbs after the initial link to the home page. You can do this by adding the following code to your functions.php file:

function yoast_seo_breadcrumb_append_link( $links ) {
    global $post;
        $breadcrumb[] = array(
            'url' => site_url( '/blog/' ),
            'text' => 'Blog',
        );
        array_splice( $links, 1, -2, $breadcrumb );
    return $links;
}
add_filter( 'wpseo_breadcrumb_links', 'yoast_seo_breadcrumb_append_link' );

Here is a broader article on how to add breadcrumbs to WordPress sites

Join the Discussion
0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!

Savvy WordPress Development official logo