Question

#578129
  • Resolved Anonymous
    Rank Math free

    Hi, I have questions regarding your YouTube video on silo.

    https://www.youtube.com/watch?v=5EkSj0nrCpg

    Based on the steps in the video, I made a new page (example.com/seo) and redirected the category page (example.com/category/seo) to it using a 301 redirect. However, I noticed the breadcrumb for the category URL contains the word, “category”. For example, Home > SEO (example.com/category/seo) > What is SEO (post page). The category URL displays the term “category” instead of the actual name of the category. However, if I enabled the option to strip Category Base, the above YouTube video silo method does not work.

    Also, is there a way to remove the word “category” from the breadcrumb URL and for the above Silo method to work?

    Could you please advise?

    Thank you.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    Could you please share the actual URL so we can check as well?

    Meanwhile, please try adding the following filter to see if that strips the /category/ from the breadcrumbs URL:

    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    	$get_post_category = get_the_category();
    
    	if ($get_post_category) {
    	  foreach($get_post_category as $category) {
    		  $url = get_category_link( $category->term_id );$i=0;
    		  while(count($crumbs) >= $i){
    			  if($url == $crumbs[$i][1]){
    				  $parsed_url = parse_url($url);
    				  $crumbs[$i][1] =  str_replace('/category/', '/', $url);
    			  }$i++;
    		  }
    	  }
    	}
    	return $crumbs;
    }, 10, 2);

    Here’s how you can add a filter/hook to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Let us know how this goes.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Question’ is closed to new replies.