No Index Paginated Pages by Ajax

#490458
  • Resolved Richard
    Rank Math free

    Hi,

    I am using DIVI and their module Woo Products uses in Product Categories pagination by AJAX. So recommended setting “Noindex Subpages” is not working for paginated pages and there are still set to “index”. I found out that it is because they do not use default WordPress pagination.

    Example: https://repekum.cz/deodoranty/?product-page=2

    How can I please set paginated pages (?product-page) in product categories to “no index” (but stay follow)?

    Thank you very much
    Richard BB

Viewing 3 replies - 1 through 3 (of 3 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.

    In this case, you can use this filter to set the paged or filtered products to noindex:

    // Noindex filter queries
    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    $url = home_url( $_SERVER['REQUEST_URI'] );
    if (strpos($url,'?product-page=') !== false) {
    $robots['index'] = "noindex";
    $robots['follow'] = 'follow';
    };
    return $robots;
    });

    And here’s a link to how to apply this to your site:
    https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php

    I hope that helps.

    Thank you.

    Thank you very much. It works perfectly. Great support!

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

You must be logged in to reply to this ticket.