Pagination is not being set as noindex

#10679
  • Resolved Shoutify Me
    Rank Math free

    Hi! I have “Noindex Paginated Pages” to on and “Noindex Archive Subpages” also set to on. But I’m still seeing some links in search index which are not set to noindex. If you search “site:giggloshop.com/bird-feeder” you will see two links which show ?orderby=date and ?orderby=rate parameters. How can I set them to no-index?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I have entered the search term site:giggloshop.com/bird-feeder and this returns 3 results with none of the mentioned paginated pages. This seems to be working as expected. Please share some screenshots if your results are different.

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hi!
    As you entere the search term site:giggloshop.com/bird-feeder you get three results. One of them is simple version and two of them shows perameters as ?orderby=date and ?orderby=rate. How can I set these two as no index with RankMath?

    Hi there,

    Thanks for the follow up.

    I have modified the code you have on your functions.php file to check for query strings and set the pages to noindex like so:

    /**
    * Adjusting product page's robots
    * @return string
    */
    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    if (is_product() || $_SERVER['QUERY_STRING'] =="orderby=date" || $_SERVER['QUERY_STRING'] =="orderby=menu_order" || $_SERVER['QUERY_STRING'] =="orderby=popularity" || $_SERVER['QUERY_STRING'] =="orderby=popularity" || $_SERVER['QUERY_STRING'] =="orderby=price" || $_SERVER['QUERY_STRING'] == "orderby=price-desc" ) {
    $robots['index'] = 'noindex';
    $robots['follow'] = 'nofollow';
    	return $robots;
    }
    return $robots;
    });

    I hope this info helps. Thank you.

    Hi! Thank you for the code but it worked partially and didn’t noindex order by rating querry. But I managed to figure it out and changed your code to following. `/**
    * Adjusting product page’s robots
    * @return string
    */
    add_filter( ‘rank_math/frontend/robots’, function( $robots ) {
    if (is_product() || $_SERVER[‘QUERY_STRING’] ==”orderby=date” || $_SERVER[‘QUERY_STRING’] ==”orderby=menu_order” || $_SERVER[‘QUERY_STRING’] ==”orderby=popularity” || $_SERVER[‘QUERY_STRING’] ==”orderby=popularity” || $_SERVER[‘QUERY_STRING’] ==”orderby=price” || $_SERVER[‘QUERY_STRING’] ==”orderby=rating” || $_SERVER[‘QUERY_STRING’] == “orderby=price-desc” ) {
    $robots[‘index’] = ‘noindex’;
    $robots[‘follow’] = ‘nofollow’;
    return $robots;
    }
    return $robots;
    });
    `

    Hi there,

    Thanks for the follow up.

    I am glad that this worked for you. If you want to set all the query params to noindex on your site, you could also do this:

    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    if ($_GET) {
    $robots['index'] = 'noindex';
    $robots['follow'] = 'nofollow';
    return $robots;
    }
    return $robots;
    });

    Feel free to contact us for any other issues. Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

The ticket ‘Pagination is not being set as noindex’ is closed to new replies.