• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

noindexing link rel="next" page/2/ and so on…….

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › noindexing link rel="next" page/2/ and so on…….

This topic is: not resolved

Tagged: noindex, seo

  • This topic has 9 replies, 2 voices, and was last updated 6 years, 3 months ago by Brad Dalton.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • December 1, 2016 at 7:35 am #196851
    darren_c
    Member

    OK, with a widgetised homepage the rel=next function is just a nuisance since all it will do is create an exact copy of the original page. Nothing I do will remove this so I have resorted to disallowing '/page/*' in robots.txt

    This is hardly an ideal situation so is there a way of adding 'noindex' to these 'pages' without resorting to using a bloated 'seo' plug-in?

    I am thinking something like this:

    add_action( 'wp_head', 'add_noindex' );
    function add_noindex() {
    if(is_archive()) {
    echo '<meta name="robots" content="noindex,follow" />';
    }
    }   

    Obviously this will only work for archive pages, but can it be modified to suit my needs?

    December 1, 2016 at 9:00 am #196858
    Brad Dalton
    Participant

    You can easily noindex any page using the Genesis SEO settings.


    Tutorials for StudioPress Themes.

    December 2, 2016 at 7:08 am #196909
    darren_c
    Member

    Not when the pages are auto-generated.

    December 2, 2016 at 7:23 am #196910
    Brad Dalton
    Participant

    How are you auto generating the pages?


    Tutorials for StudioPress Themes.

    December 2, 2016 at 8:10 am #196913
    darren_c
    Member

    I'm not, the pages are auto-generated when you follow the link. For example: Agency Pro Demo Site
    http://demo.studiopress.com/agency/

    #69 <link rel="next" href="http://demo.studiopress.com/agency/page/2/" />

    generates:

    http://demo.studiopress.com/agency/page/2/

    which is just a duplicate of the original page. Thankfully page 2 links back to the original otherwise you would have an infinite number of duplicates to contend with.

    #69 <link rel="prev" href="http://demo.studiopress.com/agency/" />

    December 4, 2016 at 6:30 am #196967
    Brad Dalton
    Participant

    You can use the settings to noindex archive pages or use your code.


    Tutorials for StudioPress Themes.

    December 5, 2016 at 8:10 am #197051
    darren_c
    Member

    Thanks, I already knew this but I wasn't asking about noindexing archives.

    December 5, 2016 at 8:52 am #197053
    Brad Dalton
    Participant

    I would try the is_paged() conditional tag.


    Tutorials for StudioPress Themes.

    December 6, 2016 at 1:23 am #197107
    darren_c
    Member

    OK, thanks.

    This works and adds 'noindex,follow' to any pages after the first homepage

    //* Noindex homepage rel=next page/2 etc
    add_action( 'wp_head', 'add_noindex' );
    function add_noindex() {
    if(is_paged()) {
    echo '<meta name="robots" content="noindex,follow" />';
    }
    }

    It's not ideal, I'd really like these links not to be generated in the first place, but I think noindexing is a better solution than disallowing via robots.txt?

    Thanks again

    December 6, 2016 at 7:57 am #197113
    Brad Dalton
    Participant

    You can remove pagination.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble