WordPress.org

Support

Support » Plugins and Hacks » How do I remove CPT from breadcrumb trail?

How do I remove CPT from breadcrumb trail?

Viewing 3 replies - 1 through 3 (of 3 total)
  • There are a number of filters available which you can use to change the output.

    You’ll probably want the wpseo_breadcrumb_single_link filter in this case.

    Thank you Juliette! You wouldn’t happen to know of a good tutorial for php beginners on how to use this filter by any chance?

    @jsperl, this filter is no different from other filters, so any tutorial on how to create filter functions should do:
    https://www.google.nl/search?q=WordPress+how+to+create+a+filter+function+for+a+filter+hook

    Most important thing to remember is to return the result.

    Basic setup could look like:

    add_filter( 'wpseo_breadcrumb_single_link', 'my_breadcrumb_filter_function' );
    
    function my_breadcrumb_filter_function( $full_link, $link_info ) {
    	/* Do something, for instance:
    	   - test the link info for certain information and clear the $full_link, i.e.:
    	if( $link_info['url'] === 'xyz' ) {
    		$full_link = '';
    	}
    	*/
    	return $full_link;
    }

    You could also have a look at the wpseo_breadcrumb_links filter which is run before the crumbs are converted to links.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I remove CPT from breadcrumb trail?’ is closed to new replies.