Skip to content

Instantly share code, notes, and snippets.

@Willem-Siebe
Last active July 8, 2017 19:29
Show Gist options
  • Save Willem-Siebe/6f43704e8536fc308fc3 to your computer and use it in GitHub Desktop.
Save Willem-Siebe/6f43704e8536fc308fc3 to your computer and use it in GitHub Desktop.
Remove Shop page from WordPress SEO (Yoast) WooCommerce breadcrumb on is_product page, see http://wpquestions.com/question/showChrono/id/8603.
// Remove Shop page from WooCommerce breadcrumb on is_product page, see https://gist.github.com/Willem-Siebe/6f43704e8536fc308fc3.
function wsis_wpseo_breadcrumb_output( $output ){
if( is_product() ){
$from = ' » <span typeof="v:Breadcrumb"><a href="http://yoururl.com/shop/" rel="v:url" property="v:title">Producten</a></span>';
$to = '';
$output = str_replace( $from, $to, $output );
}
return $output;
}
add_filter( 'wpseo_breadcrumb_output', 'wsis_wpseo_breadcrumb_output' );
@lukeseall
Copy link

Try replacing http://yoururl.com With '.site_url().'. This will work on any domain if you are running a staging site for example.

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