# Noindex Paginated Archives With Rank Math

> Sets page 2 and later of archives to noindex, follow through Rank Math's robots meta, keeping the first page indexable.

- Type: PHP
- Runs: Frontend only
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: rank-math, noindex, pagination
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/rankmath-noindex-paged-archives/

## Code

```php
add_filter( 'rank_math/frontend/robots', function ( $robots ) {
    if ( is_paged() && is_array( $robots ) ) {
        $robots['index']  = 'noindex';
        $robots['follow'] = 'follow';
    }

    return $robots;
} );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Noindex Paginated Archives With Rank Math" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
