
Many WordPress websites – especially WooCommerce shops – have the problem: Google indexes paginated pages like /shop/page/2/ or /category/page/3/. This can lead to duplicate content, keyword cannibalization, and a poorer crawl budget! ATTENTION! In this post, we will show you how to exclude all /page/ pages from indexing with a simple code snippet – including Yoast SEO support, WooCommerce compatibility, and canonical optimization.
WordPress SEO: noindex, nofollow for pagination pages /page/2/, /page/3/ & Co. with Yoast + WooCommerce
Paginated pages like /page/2/,/page/3/ or even /category/page/5/ are part of almost every WordPress site – whether it’s a blog, a company website or a WooCommerce shop. However, from an SEO perspective, these pages often pose a problem: they usually contain no independent content, offer no added value for search engines, and in the worst case can lead to duplicate contentandkeyword cannibalization.
Especially for shops and extensive categories, this can lead to Google indexing unnecessary subpages – while the important page 1 loses visibility.
With the popular SEO plugin Yoast SEO, this behavior can only be controlled to a limited extent. Therefore, in this post, we will show you how to exclude all paginated pages from Google indexing with a small snippet and at the same time set the canonical tag to page 1 – compatible with WooCommerce, Yoast and all archive types.

🧠 Why is it important not to index pagination?
- Paginated pages have little individual content
- Google prefers page-by-page structured content with clear Canonicals
/page/2/can be considered a duplicate or inferior page- Only page 1 should be indexed to consolidate SEO strength
Imagine you have 1000 products and only display 50 products per page.
Then, according to Google, you have 20 pages without added value. Do Google or other search engines like that? NO!
🔧 The Solution: Canonical & Noindex for Paginated Pages
With the following code, you achieve two things:
- Set canonical to Page 1 – e.g., from
/page/3/→/category/ noindex,followfor all paginated pages – Google crawls, but does not index
💻 The code for your functions.php or as a snippet
return get_permalink($shop_page_id);
}
}
// Category, tag, custom taxonomy
if (is_category() || is_tag() || is_tax()) {
$term_link = get_term_link(get_queried_object());
if (!is_wp_error($term_link)) {
return $term_link;
}
}
// Post type archive
if (is_post_type_archive()) {
$post_type = get_post_type();
if ($post_type) {
$archive_link = get_post_type_archive_link($post_type);
if ($archive_link) {
return $archive_link;
}
}
}
// Author archive
if (is_author()) {
$author_id = get_queried_object_id();
if ($author_id) {
return get_author_posts_url($author_id);
}
}
Become more visible on Google & Social Media?
In a free strategy consultation for data-driven online marketing, we uncover your untapped potential, review any existing ad accounts if necessary, examine your SEO ranking and visibility, and determine which strategy is appropriate for your budget and which active measures will lead to more inquiries or sales.

✅ More visibility & perception through targeted placement
✅ More visitors > prospects > customers > revenue
✅ Reach target groups scalably with SEA
✅ Act and grow sustainably with SEO
🫵 Maximum success with our hybrid strategy
💪 More than 15 years of experience across industries in over 1,000+ projects demonstrable!
// Date archive
if (is_date()) {
return get_pagenum_link(1);
}
// Fallback: use Yoast’s original canonical
return $canonical;
}, 10, 1);
// Exclude paginated pages from indexing
add_filter(‚wpseo_robots‘, function($robots) {
if (!is_paged()) {
return $robots;
}
// Check whether noindex is already set
if (is_string($robots) && strpos($robots, ’noindex‘) !== false) {
return $robots;
}
// Set noindex,follow
return ’noindex,follow‘;
}, 10, 1);
🔍 What happens with this code?
| Page Type | Canonical | Robots Meta |
|---|---|---|
/shop/ |
itself | index, follow |
/shop/page/2/ |
/shop/ |
noindex, follow |
/kategorie/page/3/ |
/kategorie/ |
noindex, follow |
/blog/page/4/ |
/blog/ |
noindex, follow |
✅ Page 1 continues to be indexed and remains the SEO target.
❌ All other pages are not indexed but still pass on link juice.
Example from the later HTML source code:
Page 1:
- <link rel=“canonical“ href=“https://www.XYZ.de/stoffe/polsterstoffe-moebelstoffe/“ class=“yoast-seo-meta-tag“ />
- <link rel=“next“ href=“https://www.XYZ.de/stoffe/polsterstoffe-moebelstoffe/page/2/“ class=“yoast-seo-meta-tag“ />
Page 2 and following:
- <link rel=“canonical“ href=“https://www.XYZ.de/stoffe/polsterstoffe-moebelstoffe/“ class=“yoast-seo-meta-tag“ />
- <link rel=“prev“ href=“https://www.XYZ.de/stoffe/polsterstoffe-moebelstoffe/“ class=“yoast-seo-meta-tag“ />
- <link rel=“next“ href=“https://www.XYZ.de/stoffe/polsterstoffe-moebelstoffe/page/3/“ class=“yoast-seo-meta-tag“ />
- etc.
Paginated pages are important for user-friendliness – but not necessarily for Google indexing.
With this snippet, you control your SEO precisely:
- No duplicate content
- Clear canonical focus
- Better crawling efficiency
🔄 Tip: Place the code as a snippet via a plugin such as Code Snippets so that your theme update does not overwrite it:
📈 Still have questions about WordPress SEO optimization?
I am happy to help with individual SEO setups for WooCommerce, blogs, or corporate websites.
Send me a message or arrange a free initial consultation.
Florian Ibe
CEO & Marketing Consultant
Your contact person: Florian Ibe
Questions and answers about Canonical and noindex for pages
1. Should you really set all paginated pages to noindex?
Answer:
Yes – in most cases, it makes sense to set paginated pages such as /page/2/and/page/3/ to noindex,follow. These pages often contain no standalone content and can lead to duplicate content. It is important that you retain follow so that Google can continue to follow the links. This way, visibility is concentrated on the first page of the archive.
2. Does noindex,follow affect the crawling or ranking of the remaining pages?
Answer:
No – noindex,follow only ensures that Google does not include the page in the index, but continues to follow the links contained within it. Crawling and internal linking therefore remain intact. You only reduce „SEO noise“ from irrelevant or weak pages.
3. Why is Yoast's canonical tag alone not enough?
Answer:
Yoast does automatically set the canonical tag correctly on paginated pages to, for example, /page/2/ itself. However, this is not enough to prevent Google from indexing the page. Only by setting noindex in the <meta name="robots"> tag can you reliably instruct Google not to index the page – this usually requires an additional snippet like the one shown here.
By the way, this problem has been known since 2018, but especially due to the „new“ topic of AI Search and various Google updates, it keeps causing problems:









