About Misc Pages

#475655
  • Resolved Afrizal
    Rank Math free

    On Misc Pages, there are 2 different options about paginated.

    1. Noined Subpages
    2. Noindex Paginated Single Pages

    I just dont want my paginated pages on Categories being indexed (i.e: domain.com/music/page/2/)

    but I want my main paginated pages indexed (i.e: domain.com/page/2/)

    Which one I should disable and enable? Thanks in advance

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention.

    In this case, it’s not possible with those options since you only want to noindex the paginated pages of the categories, but keep the other paginated pages indexed and the setting applies to everything.

    However, this code snippet should help circumvent that and get the final desired result:

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

    The filter should be added to your active theme’s functions.php file (last line).

    Here’s another way to apply the filter using the rankmath.php file:
    https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php

    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 ‘About Misc Pages’ is closed to new replies.