• Resolved dukearmi

    (@dukearmi)


    Hello there,

    I’m wondering how I can make the display URL in Google SERPs show the URL slug instead of the category.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Anh Tran

    (@rilwis)

    Hi @dukearmi

    In the latest version of Slim SEO, you can remove the /category/ base from category URL. So it will help making category URL showing only slugs. Then probably after some time, Google will update your pages in SERPs. But when it’s updated, it depends totally on Google.

    Thread Starter dukearmi

    (@dukearmi)

    Hi @rilwis

    I noticed that and it’s a great feature! But I don’t mean the “category” showing before the category name. I mean the display/visible URL in Google’s SERPs shows the category name instead of the post’s URL.

    Example:

    Post URL: https://site.com/german-shepherd
    Category: dogs

    SERPS show “https://site.com ? Dogs” not “https://site.com ? German-Shepherd”

    Screenshot: https://ibb.co/PMTMSMf

    Plugin Author Anh Tran

    (@rilwis)

    Usually that depends on the Breadcrumbs schema, where in Slim SEO it’s done automatically in the format:

    Home > Blog (if you set a static Blog page) > Category > Post title

    If you don’t want to have category in the breadcrumbs schema, then you can remove it using this filter.

    However, this doesn’t guarantee how it looks in the SERPs. How the links are displayed in SERPs depends 100% on Google, and it can choose what’s best to show in the SERPs.

    Thread Starter dukearmi

    (@dukearmi)

    Thank you! I’ll try this and hopefully it resolves the issue. I did notice that the display URL on mobile shows Domain URL ? Post URL slug. So what are the index for the category in the “Home > Blog > Category > Post” schema? I could only see the index for Blog in link you shared.

    Plugin Author Anh Tran

    (@rilwis)

    The index are counted from 0, so: Home – 0, Blog – 1, Category – 2, etc.

    You can var dump the links to see what there before unset them:

    add_filter( 'slim_seo_breadcrumbs_links', function( $links ) {
    // Only process single posts.
    if ( ! is_single() ) {
    return $links;
    }

    // Debug. Remove these 3 lines when it works.
    echo '<pre>';
    print_r( $links );
    echo '</pre>';

    unset( $links[2] ); // Remove Category (if you have Blog)
    // unset( $links[1] ); // Remove Category (if you don't have Blog)
    } );

    Thread Starter dukearmi

    (@dukearmi)

    Thank you very much for the thorough response, @rilwis ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.