undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • MozCon

      Save on Early Bird tickets and join us in London or New York City

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

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

  1. Home
  2. SEO Tactics
  3. Intermediate & Advanced SEO
  4. Yoast & rel canonical for paginated Wordpress URLs

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

Yoast & rel canonical for paginated Wordpress URLs

Intermediate & Advanced SEO
2
9
13.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • aactive
    aactive last edited by Sep 25, 2013, 5:22 PM

    Hello, our Wordpress blog at http://www.jobs.ca/career-resources has a rel canonical issue since we added pagination to the front page and category-pages. We're using Yoast and it's incorrectly applying a rel-canonical meta tag referencing page 1 on page 2, 3, etc. This is a known misuse of the rel-canonical tag (per Google's Webmaster Blog - http://googlewebmastercentral.blogspot.ca/2013/04/5-common-mistakes-with-relcanonical.html, which says rel-canonical should be replaced with rel-prev and rel-next for page 2, 3, etc.).

    We don't see a way to specify anywhere in Yoast's options to correct this behaviour for page 2, 3, etc. Yoast allows you to override a page's canonical URL, otherwise it automatically uses the Wordpress permalink.

    My question is, does anyone know how to configure Yoast to properly replace rel-canonical tags with rel-prev and rel-next for paginated URLs, or do I need to look at another plugin or customize the behavior directly in my child theme code?

    This issue was brought up here as well: http://moz.com/community/q/canonical-help, but the only response did not relate to Yoast.

    (We're using Wordpress 3.6.1 and Yoast "Wordpress SEO" 1.4.18)

    1 Reply Last reply Reply Quote 0
    • evolvingSEO
      evolvingSEO @aactive last edited by Oct 18, 2013, 4:04 PM Oct 18, 2013, 4:04 PM

      Thanks for posting this Shaun! People actually do come back and read these months to come and these Q&A's will return in search results, so you've made this a really valuable page for future readers - thanks!

      -Dan

      1 Reply Last reply Reply Quote 0
      • aactive
        aactive last edited by Oct 17, 2013, 9:08 PM Oct 17, 2013, 9:06 PM

        I've now fixed this issue by refactoring our child theme so the WP queries occur before the header (inserting the content later).

        Because we're using a custom homepage template for the front page and a custom "category page" template, I've also had to modify Yoast's "canonical" and "adjacent_rel_links" functions to understand the pagination for those pages (otherwise Yoast simply detects these as "singular" pages and only applies the rel canonical pointing to page 1, regardless of the current page).

        I used the following code to allow overriding Yoast in my child-theme's functions.php:

        if (defined('WPSEO_VERSION')) {
            function custom_wpseo_override() {

        global $wpseo_front;

        remove_action('wpseo_head', array($wpseo_front, 'canonical'), 20);
            add_action('wpseo_head', 'custom_wpseo_canonical', 20);
            remove_action('wpseo_head', array($wpseo_front, 'adjacent_rel_links'), 21);
            add_action('wpseo_head', 'custom_wpseo_adjacent_rel_links', 21);
            }
            add_action('init','custom_wpseo_override');
        }

        evolvingSEO 1 Reply Last reply Oct 18, 2013, 4:04 PM Reply Quote 1
        • evolvingSEO
          evolvingSEO @aactive last edited by Oct 15, 2013, 2:05 PM Oct 15, 2013, 2:05 PM

          Shaun

          Great, thanks - happy to help!

          -Dan

          1 Reply Last reply Reply Quote 0
          • aactive
            aactive @evolvingSEO last edited by Oct 15, 2013, 1:56 PM Oct 15, 2013, 1:56 PM

            Hi Dan,

            Yeah it must me some kind of conflict with the theme or another plugin... We're not using Thesis or Genesis but we have modified header.php in our child theme to replace the masthead markup (just stuff within the body tag). I just noticed the other day that both the theme (ExtraNews by ThemeForest) and Yoast are adding their own <title>tags, so there may be more conflicts than one.</p> <p>Marking your response as an answer because you proved that Yoast can insert the rel next & prev tags and you've helped me get to the point where I'm 80% sure it's a theme conflict. Thanks again!</p></title>

            evolvingSEO 1 Reply Last reply Oct 15, 2013, 2:05 PM Reply Quote 0
            • evolvingSEO
              evolvingSEO @aactive last edited by Oct 15, 2013, 1:56 PM Oct 11, 2013, 11:59 PM

              Hi Shaun

              Yes in terms of keeping strictly to Google's guidelines, I agree that Yoast should in theory use either prev/next or canonical on subpages, but not both.

              I am honestly not certain the settings it could be otherwise, as "subpages of archives" is the only one I know of that handles pagination.

              Could there be another plugin or your theme (or custom coding in header.php) causing a conflict? One thing you can do is shut off other plugins one by one to diagnose. You can switch themes or switch to the default header.php file included with WordPress, but I (for obvious reasons) do NOT recommend doing that on a live website. I'm not sure if you have a testing environment.

              Are you using a framework like Thesis or Genesis?  Sometimes those can cause unexpected things to happen as well.

              -Dan

              aactive 1 Reply Last reply Oct 15, 2013, 1:56 PM Reply Quote 1
              • aactive
                aactive @evolvingSEO last edited by Oct 11, 2013, 7:40 PM Oct 11, 2013, 7:31 PM

                Hi Dan, and thanks very much for your response.

                Per your screenshot, I believe it's not ideal that there's a rel canonical meta-tag pointing to the current partial page (page 2).

                From the Google blog link above: "In cases of paginated content, we recommend either a rel=canonical from component pages to a single-page version of the article, or to use rel=”prev” and rel=”next” pagination markup."

                They mention here https://support.google.com/webmasters/answer/1663744?hl=en (2nd last point) that it's optional to include a rel canonical tag like yours, but without the "Noindex subpages of archives" option enabled, it would probably cause your separate post pages to be indexed, which may or may not be ideal for you depending on how authoritative/complete each individual page's content is.

                Yoast is definitely adding the rel prev & next meta-tags for you though, which is exactly what I need (minus the rel canonical). I wonder which exact setting is enabling that for you... We have very few Yoast options enabled/configured at all currently, but I don't see any that are specific to the rel prev & next tags.

                I've tried enabling the "Noindex subpages of archives" per your suggestion, but it didn't result in any change in the meta-tags for my site (verified after caches cleared too).

                Any other suggestions you have would be great. My colleagues want to keep Yoast for it's other features, so I may go the route of forking/modifying the Yoast plugin code to fit our situation if needed.

                Thanks for your time!

                evolvingSEO 1 Reply Last reply Oct 11, 2013, 11:59 PM Reply Quote 0
                • topic:timeago_earlier,11 days
                • evolvingSEO
                  evolvingSEO last edited by Sep 30, 2013, 12:18 PM Sep 30, 2013, 12:18 PM

                  Hi Shaun

                  Dan here, one of the Moz Associates - we're very sorry for the delay!

                  I've attached a screenshot of my own personal company site which uses the Yoast Plugin - just want to verify the code as seen here is what I would consider "correct" and best practice for WordPress pagination.

                  That code has not require any custom coding or anything. So either we need to get the Yoast settings correct, or something else may be interfering with Yoast.

                  Please first try going to: Yoast SEO->Titles/Meta and select "Noindex subpages of archives". This to my knowledge is the only setting that needs to be made to handle pagination correctly.

                  Let us know if that works - and again, apologies for the delay. Sometimes we have quite a backlog and don't pick up right away if the community has not appropriately answered a question.

                  Thanks!

                  -Dan

                  lRYcPOhI

                  aactive 1 Reply Last reply Oct 11, 2013, 7:31 PM Reply Quote 1
                  • aactive
                    aactive last edited by Sep 27, 2013, 3:05 PM Sep 27, 2013, 3:05 PM

                    Do the 30+ people who've viewed this question think it answered itself? I tried to be thorough, but was it too much to read? Or... Is this not a great place to ask such a question?

                    1 Reply Last reply Reply Quote 1
                    • 1 / 1
                    1 out of 9
                    • First post
                      1/9
                      Last post

                    Got a burning SEO question?

                    Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                    Start my free trial


                    Browse Questions

                    Explore more categories

                    • Moz Tools

                      Chat with the community about the Moz tools.

                    • SEO Tactics

                      Discuss the SEO process with fellow marketers

                    • Community

                      Discuss industry events, jobs, and news!

                    • Digital Marketing

                      Chat about tactics outside of SEO

                    • Research & Trends

                      Dive into research and trends in the search industry.

                    • Support

                      Connect on product support and feature requests.

                    • See all categories

                    Related Questions

                    • thpchlk

                      How to handle sorting, filtering, and pagination in ecommerce? Canonical is enough?

                      Hello, after reading various articles and watching several videos I'm still not sure how to handle faceted navigation (sorting/filtering) and pagination on my ecommerce site. Current indexation status: The number of "real" pages (from my sitemap) - 2.000 pages Google Search Console (Valid) - 8.000 pages Google Search Console (Excluded) - 44.000 pages Additional info: Vast majority of those 50k additional pages (44 + 8 - 2) are pages created by sorting, filtering and pagination. Example of how the URL changes while applying filters/sorting: example.com/category --> example.com/category/1/default/1/pricefrom/100 Every additional page is canonicalized properly, yet as you can see 6k is still indexed. When I enter site:example.com/category in Google it returns at least several results (in most of the cases the main page is on the 1st position). In Google Analytics I can see than ~1.5% of Google traffic comes to the sorted/filtered pages. The number of pages indexed daily (from GSC stats) - 3.000 And so I have a few questions: Is it ok to have those additional pages indexed or will the "real" pages rank higher if those additional would not be indexed? If it's better not to have them indexed should I add "noindex" to sorting/filtering links or add eg. Disallow: /default/ in robots.txt? Or perhaps add "noindex, nofollow" to the links? Google would have then 50k pages less to crawl but perhaps it'd somehow impact my rankings in a negative way? As sorting/filtering is not based on URL parameters I can't add it in GSC. Is there another way of doing that for this filtering/sorting url structure? Thanks in advance, Andrew

                      Intermediate & Advanced SEO | Aug 31, 2020, 7:57 PM | thpchlk
                      0
                    • tnixis

                      Is a Wordpress AMP plugin sufficient, or should we upgrade our WP theme to an AMP theme?

                      Hello there,  our site is on a Flatsome Wordpress theme (which is responsive and does not support AMP), and we are currently using the AMP for Wordpress plugin on our blog and other content rich pages. My question is - is a plugin sufficient to make our pages AMP friendly? Or should we consider switching to a theme that is AMP enabled already? Thanks!
                      Katie

                      Intermediate & Advanced SEO | Jun 22, 2019, 12:33 PM | tnixis
                      0
                    • PeterRota

                      Set up a rel canonical

                      I have a question. I was wondering, if it was possible to set up a rel canonical. When I can't access the non canonical pages? For example, my site as at www.site.com , but the non cannocail is at site.com is their any way to set thet up without actually edting it at site.com ? Thanks for your help

                      Intermediate & Advanced SEO | May 12, 2013, 8:47 PM | PeterRota
                      0
                    • KateV

                      Does Google hate wordpress?

                      I have my categories pages set to noindex, follow. I deactivated the author and date based archives, and all the /page/2 /page/3 are noindex. Is this the right approach? I had thought about adding some text to the topic of each category page and then changing them to index. I'm using showing recent post excerpts on the homepage. Another other suggestions? I think two of my sites are in panda for no good reason. It seems like non-wordpress blogs in my industry do better than comparable wordpress sites.

                      Intermediate & Advanced SEO | Apr 2, 2013, 2:03 PM | KateV
                      0
                    • 379seo

                      Canonical URLs and Sitemaps

                      We are using canonical link tags for product pages in a scenario where the URLs on the site contain category names, and the canonical URL points to a URL which does not contain the category names.  So, the product page on the site is like www.example.com/clothes/skirts/skater-skirt-12345, and also like www.example.com/sale/clearance/skater-skirt-12345 in another category.  And on both of these pages, the canonical link tag references a 3rd URL like www.example.com/skater-skirt-12345.  This 3rd URL, used in the canonical link tag is a valid page, and displays the same content as the other two versions, but there are no actual links to this generic version anywhere on the site (nor external). Questions: 1. Does the generic URL referenced in the canonical link also need to be included as on-page links somewhere in the crawled navigation of the site, or is it okay to be just a valid URL not linked anywhere except for the canonical tags? 2. In our sitemap, is it okay to reference the non-canonical URLs, or does the sitemap have to reference only the canonical URL?  In our case, the sitemap points to yet a 3rd variation of the URL, like www.example.com/product.jsp?productID=12345.  This page retrieves the same content as the others, and includes a canonical link tag back to www.example.com/skater-skirt-12345.  Is this a valid approach, or should we revise the sitemap to point to either the category-specific links or the canonical links?

                      Intermediate & Advanced SEO | Oct 26, 2012, 6:28 PM | 379seo
                      0
                    • imiJoe

                      Does Bing support rel="canonical" HTTP Headers?

                      anyone know^

                      Intermediate & Advanced SEO | Aug 9, 2012, 5:58 PM | imiJoe
                      0
                    • SDLOnlineChannel

                      Is it ok to use both 301 redirect and rel="canonical' at the same time?

                      Hi everyone, I'm sorry if this has been asked before. I just wasn't able to find a response in previous questions. To fix the problems in our website regarding duplication I have the possibility to set up 301's and, at the same time, modify our CMS so that it automatically sets a rel="canonical" tag for every page that is generated. Would it be a problem to have both methods set up? Is it a problem to have a on a page that is redirecting to another one? Is it advisable to have a rel="canonical" tag on every single page? Thanks for reading!

                      Intermediate & Advanced SEO | May 25, 2012, 12:18 PM | SDLOnlineChannel
                      0
                    • AndreVanKets

                      Is it safe to redirect multiple URLs to a single URL?

                      Hi, I have an old Wordress website with about 300-400 original pages of content on it. All relating to my company's industry: travel in Africa. It's a legitimate site with travel stories, photos, advice etc. Nothing spammy about. No adverts on it. No affiliates. The site hasn't been updated for a couple of years and we no longer have a need for it. Many of the stories on it are quite out of date. The site has built up a modest Mozrank value over the last 5 years, and has a few hundreds organically achieved inbound links. Recently I set up a swanky new branded website on ExpressionEngine on a new domain. My intention is to: Shut down the old site Focus all attention on building up content on the new website Ask the people linking to the old site to my new site instead (I wonder how many will actually do so...) Where possible, setup a 301 redirect from pages on the old site to their closest match on the new site Setup a 301 redirect from the old site's home page to new site's homepage Sounds good, right? But there is one issue I need some advice on... The old site has about 100 pages that do not have a good match on the new site. These pages are outdated or inferior quality, so it doesn't really make sense to rewrite them and put them on the new site. I call these my "black sheep pages". So... for these "black sheep pages" should I (A) redirect the urls to the new site's homepage (B) redirect the urls the old site's home page (which in turn, redirects to the new site's homepage, or (C) not redirect the urls, and let them die a lonely 404 death? OPTION A: oldsite.com/page1.php -> newsite.com
                      oldsite.com/page2.php -> newsite.com
                      oldsite.com/page3.php -> newsite.com
                      oldsite.com/page4.php -> newsite.com
                      oldsite.com/page5.php -> newsite.com
                      oldsite.com -> newsite.com OPTION B: oldsite.com/page1.php -> oldsite.com
                      oldsite.com/page2.php -> oldsite.com
                      oldsite.com/page3.php -> oldsite.com
                      oldsite.com/page4.php -> oldsite.com
                      oldsite.com/page5.php -> oldsite.com
                      oldsite.com -> newsite.com OPTION 😄 oldsite.com/page1.php : do not redirect, let page 404 and disappear forever
                      oldsite.com/page2.php : do not redirect, let page 404 and disappear forever
                      oldsite.com/page3.php : do not redirect, let page 404 and disappear forever
                      oldsite.com/page4.php : do not redirect, let page 404 and disappear forever
                      oldsite.com/page5.php : do not redirect, let page 404 and disappear forever
                      oldsite.com -> newsite.com My intuition tells me that Option A would pass the most "link juice" to my new site, but I am concerned that it could also be seen by Google as a spammy redirect technique. What would you do? Help 😐

                      Intermediate & Advanced SEO | Oct 6, 2011, 11:41 AM | AndreVanKets
                      1

                    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
                    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 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                    • Accessibility
                    • Terms of Use
                    • Privacy

                    Looks like your connection to Moz was lost, please wait while we try to reconnect.