• Resolved Olaf Lederer

    (@finalwebsites)


    Hi,

    today I’ve noticed that the option

    If you want to prevent /page/2/ and further of any archive to show up in the search results, set this to “noindex”.

    doesn’t exists anymore. You say it right that Google might/will respect the “rel = next/prev” tags, but in my opinion there should be a choice.

    For anyone who is reading this, the following code in your functions.php will fix this problem (I don’t call it a bug right now ;))

    add_filter("wpseo_robots", function() {
    	if (is_paged()) return "noindex, follow";
    });
    
    • This topic was modified 6 years, 6 months ago by Olaf Lederer. Reason: Removed my comment about any other page/2/ URLs and the canonical URL
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support devnihil

    (@devnihil)

    This feature was removed due to Google improving how paginated page were handled, and also because having the sub pages set to noindex would prevent the user searching from being directed to the most useful page based on their query. We also have more information on why this feature isn’t going to be brought back and why it was removed here: https://github.com/Yoast/wordpress-seo/issues/8907

    Plugin Support Michael Ti?a

    (@mikes41720)

    No further response, setting to resolved.

    Thread Starter Olaf Lederer

    (@finalwebsites)

    I have noticed that the snippet above isn’t working anymore:
    The following update is necessary:

    add_filter("wpseo_robots", function($robots) {
    	if (is_paged()) {
            return 'noindex,follow';
        } else {
            return $robots;
        }
    });
    

    Thanks @finalwebsites This snippet is exactly what i needed.

    I mean yeah google “got better” but i don’t really see it. What i see is a lot of useless pagination on the index.
    What i recommend doing is noindex paginated archives. AND creating a stand alone “Show all posts” page. Instead of relying on indexed pagination for internal linking.

    Thansk to @finalwebsites
    Problem solved ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘NoIndex for archive sub-pages’ is closed to new replies.