Skip to content

Instantly share code, notes, and snippets.

@timstl
Last active February 24, 2025 07:49
Show Gist options
  • Save timstl/5348604 to your computer and use it in GitHub Desktop.
Save timstl/5348604 to your computer and use it in GitHub Desktop.
Remove "Home" link from Yoast WordPress SEO's breadcrumbs. Add to functions.php.
function tg_remove_home_breadcrumb($links)
{
if ($links[0]['url'] == get_home_url()) { array_shift($links); }
return $links;
}
add_filter('wpseo_breadcrumb_links', 'tg_remove_home_breadcrumb');
@zachakbar
Copy link

zachakbar commented Feb 18, 2025

This worked for me.

 * Hide home link for breadcrumbs
 */
function remove_home_breadcrumb($links) {
	if (isset($links[0]) && strpos($links[0]['url'], get_home_url()) !== false) {
		unset($links[0]);
	}
	return $links;
}
add_filter('wpseo_breadcrumb_links', 'remove_home_breadcrumb');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment