The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. Wordpress rel next & previous for SEO

    Wordpress rel next & previous for SEO

    Technical SEO Issues
    5 3 192
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • SEOhughesm
      SEOhughesm last edited by

      Hi,

      I have implemented this function into my wordpress theme. However,  I can only get the prev rel to show up. Does anyone have an idea?

      function rel_next_prev(){
      global $paged;

      if ( get_previous_posts_link() ) { ?>
      }

      if ( get_next_posts_link() ) { ?>
      }

      }
      add_action( 'wp_head', 'rel_next_prev' );
      ?>

      1 Reply Last reply Reply Quote 0
      • Andy.Drinkwater
        Andy.Drinkwater last edited by

        I know this might sound like a bit of a daft question, but you do have a page 2 of your blog? And if so, when you view the source of that page, do you see something like this?"prev"` `href="http://example.com/"> **``"next" href=``"http://example.com/page/2/"``>``** -Andy

        1 Reply Last reply Reply Quote 0
        • SEOhughesm
          SEOhughesm last edited by

          I have page 2, 3, 4 etc.

          Somehow the get_next_posts_link() is not fetching anything.  In my source, I only have no matter what page I'm on, and it's always fetching the prev link correctly.

          1 Reply Last reply Reply Quote 0
          • Andy.Drinkwater
            Andy.Drinkwater last edited by

            This exact question has also been asked on here previously, but without a solution I'm afraid.

            I would guess it is something within the theme that is causing this - but what, I do not know. The Yoast SEO plugin is supposed to handle this somehow, but it seems no-one knows how.

            Sorry I can't be more help on this one.

            -Andy

            1 Reply Last reply Reply Quote 0
            • evolvingSEO
              evolvingSEO last edited by

              Hi There

              I also do not know how this is done at the coding level in WordPress. The Yoast plugin handles it automatically - that's probably the least painful to get it implemented!

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • ATG & Endeca Integration & SEO implications
                0
                1
                803

              • Implementation of rel="next" & rel="prev"
                KeriMorgret
                KeriMorgret
                0
                8
                1.4k

              • Canonical & rel=prev / next changes to website a good idea or not?
                0
                1
                141

              • Rel Canonical tag using Wordpress SEO plugin
                NicDale
                NicDale
                0
                7
                1.5k

              • Will I still get Duplicate Meta Data Errors with the correct use of the rel="next" and rel="prev" tags?
                irvingw
                irvingw
                0
                6
                911

              • SEO WP Plugin Battle: Yoast Wordpress SEO vs All in One SEO?
                vijayvasu
                vijayvasu
                0
                3
                735

              • Wordpress plugins for SEO
                GregFindley.co.uk
                GregFindley.co.uk
                0
                8
                1.3k

              • Rel Canonical - Wordpress
                Agentmorris
                Agentmorris
                0
                11
                3.0k

              Get started with Moz Pro!

              Unlock the power of advanced SEO tools and data-driven insights.

              Start my free trial
              Products
              • Moz Pro
              • Moz Local
              • Moz API
              • Moz Data
              • STAT
              • Product Updates
              Moz Solutions
              • SMB Solutions
              • Agency Solutions
              • Enterprise Solutions
              • Digital Marketers
              Free SEO Tools
              • Domain Authority Checker
              • Link Explorer
              • Keyword Explorer
              • Competitive Research
              • Brand Authority Checker
              • Local Citation Checker
              • MozBar Extension
              • MozCast
              Resources
              • Blog
              • SEO Learning Center
              • Help Hub
              • Beginner's Guide to SEO
              • How-to Guides
              • Moz Academy
              • API Docs
              About Moz
              • About
              • Team
              • Careers
              • Contact
              Why Moz
              • Case Studies
              • Testimonials
              Get Involved
              • Become an Affiliate
              • MozCon
              • Webinars
              • Practical Marketer Series
              • MozPod
              Connect with us

              Contact the Help team

              Join our newsletter
              Moz logo
              © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
              • Accessibility
              • Terms of Use
              • Privacy