Skip to content

Instantly share code, notes, and snippets.

@Willem-Siebe
Last active July 8, 2017 19:29
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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