Rename "Home" in All in One SEO Breadcrumbs
Replaces the "Home" label in All in One SEO breadcrumbs with your own wording, such as your brand name.
Opens WPIDE on
Code
// New label for the homepage crumb.
$wpide_aioseo_home_label = 'Start';
add_filter( 'aioseo_breadcrumbs_trail', function ( $crumbs ) use ( $wpide_aioseo_home_label ) {
if ( ! is_array( $crumbs ) ) {
return $crumbs;
}
$home = untrailingslashit( home_url( '/' ) );
foreach ( $crumbs as $i => $crumb ) {
if ( is_array( $crumb ) && isset( $crumb['link'] ) && untrailingslashit( (string) $crumb['link'] ) === $home ) {
$crumbs[ $i ]['label'] = $wpide_aioseo_home_label;
}
}
return $crumbs;
} );
Notes
Matches the crumb that links to your homepage, whatever its current label.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.