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. Technical SEO
  4. Adding Rel Canonical to multiple pages

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.

Adding Rel Canonical to multiple pages

Technical SEO
3
9
1.7k
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.
  • jdossetti
    jdossetti last edited by Jul 16, 2012, 2:54 PM

    Hi,

    Our CMS generates a lot of duplicate content, (Different versions of every page for 3 different font sizes). There are many other reasons why we should drop this current CMS and go with something else, and we are in the process of doing that. But for now, does anyone know how would I do the following:

    I've created a spreadsheet that contains the following:

    Column 1: rel="canonical" tag for URL

    Column 2: Duplicate Content URL # 1

    Column 3: Duplicate Content URL # 2

    Column 4: Duplicate Content URL # 3

    I want to add the tag from column 1 into the head of every page from column 2,3, and 4.

    What would be a fast way to do this considering that I have around 1800 rows.

    Check the screenshot of the builtwith.com result to see more information about the website if that helps.

    Farris

    bxySL

    1 Reply Last reply Reply Quote 0
    • Dr-Pete
      Dr-Pete Staff @jdossetti last edited by Jul 20, 2012, 3:50 PM Jul 20, 2012, 3:50 PM

      Yeah, wish I could give you a simpler answer, but I'm afraid it might end up being a little tricky. Hit the biggest problems first, and at least you can manage time/money a bit. The one bright side is that the rules should be no harder to code in ColdFusion than anything else (PHP, ASP, whatever). It's just the core logic that's tricky.

      1 Reply Last reply Reply Quote 0
      • jdossetti
        jdossetti @jdossetti last edited by Jul 20, 2012, 1:54 PM Jul 20, 2012, 1:54 PM

        That's what I thought. I need to find someone in the company who knows cold fusion and go through it.

        Thanks for your help though. I appreciate it.

        Farris

        1 Reply Last reply Reply Quote 0
        • Dr-Pete
          Dr-Pete Staff @jdossetti last edited by Jul 20, 2012, 1:54 PM Jul 20, 2012, 12:45 AM

          Unfortunately, the rules may differ from page to page and will be entirely dependent on how your pages are generated. If it's just a matter of the "index.cfm" version vs. root ("/") versions of pages, those canonical should be straightforward. For the other parameters, though (like "i", "fs", etc.), it depends entirely on the function of those parameters.

          I know ColdFusion reasonably well, and even given that, I couldn't give you a one-size-fits-all rule that would solve the problem. It really has to be guided by your site structure and code/data logic. Personally, I'd start with the pattern that generates the most problems and solve that one first. In other words, if one template (like "/press-releases") generates dozens or hundreds of duplicates, deal with that first. If you solve the top 3-4 problems, you may clean up quite a bit. That could be more effective than trying to fix everything at once.

          1 Reply Last reply Reply Quote 1
          • jdossetti
            jdossetti @Dr-Pete last edited by Jul 17, 2012, 2:46 PM Jul 17, 2012, 2:46 PM

            Here's a spreadsheet sample. I did what Roberto suggested. I have a column with the ready for every duplicate content URL.

            The site is dynamic. That was the main problem I was facing, I'm not sure how to set the canonicals on each page without having to go into the html and copy the tag from the spreadsheet to the manually.

            I added the screenshot of builtwith.com in the main question hoping it would give anyone insight as to how I would code rules to set the canonicals.

            P9ygx

            Dr-Pete jdossetti 3 Replies Last reply Jul 20, 2012, 3:50 PM Reply Quote 0
            • Dr-Pete
              Dr-Pete Staff last edited by Jul 17, 2012, 1:37 AM Jul 17, 2012, 1:37 AM

              Could you provide an approximate example that matches your real situation (a fake domain is fine, but with the same basic format)? This is a situation where fake examples that don't match the real situation probably won't help us (or you) much.

              Once you have the spreadsheet, how are you going to translate that into tags? If this is a dynamic site, it would be better to be able to code rules to set the canonicals - and potentially much easier.

              jdossetti 1 Reply Last reply Jul 17, 2012, 2:46 PM Reply Quote 0
              • rmontanez
                rmontanez @jdossetti last edited by Jul 20, 2012, 1:55 PM Jul 16, 2012, 6:05 PM

                Following the same concept:

                1. Create a column (Column E) with the following information "then another column (Column F) with ""/>"
                2. In column G enter the following formula: =CONCATENATE(E1,Cell of Duplicate URL, F3).

                The end result will have Column A with the Domain in it.  Follow steps 6 & 7 to complete the process.

                Feel free to send me a sample spreadsheet with some info and I can set it up for you.

                1 Reply Last reply Reply Quote 1
                • jdossetti
                  jdossetti @rmontanez last edited by Jul 16, 2012, 5:51 PM Jul 16, 2012, 5:51 PM

                  Roberto, Thank you for your answer. I just realized that I was unclear when I asked the question. I already have the link containing the canonical tag for each of the URLs ready. That is what column A already contains. I need to add that into the section of the pages in column 2,3, and 4. I'm just unsure how to do this for 1800 rows each containing the correct URL in column A, and in column 2,3, and 4 the URLs of the duplicate content pages that need the link added to the section. Check the image below to see what I mean. I appreciate the effort though Farris

                  z7GSL

                  rmontanez 1 Reply Last reply Jul 16, 2012, 6:05 PM Reply Quote 0
                  • rmontanez
                    rmontanez last edited by Jul 16, 2012, 5:22 PM Jul 16, 2012, 5:22 PM

                    Farris,

                    This is the way I would do it.

                    You have the following columns created:

                    • Column A: "canonical" tag for UR
                    • Column B: Duplicate Content URL # 1
                    • Column 😄 Duplicate Content URL # 2
                    • Column 😧 Duplicate Content URL # 1

                    Follow the next steps:

                    1. Create three more columns with to duplicate columns B, C, D
                    2. Use the following formula on column B "**=CONCATENATE(A1,B1)" **
                    3. Copy the same formula for columns C & D
                    4. Replace the “B1” in your formula for the respective columns (i.e. Column C should have C1.)
                    5. Copy & Paste the content of columns E, F, G (The copied columns with formulas)  to all the rows.
                    6. Once copied, the information in columns E, F, G should look like the end result that you want.
                    7. if data is correct, copy columns E, F, G and paste in the same location but use Paste Special and paste values only.  This will remove your formulas.

                    I hope this helps.

                    jdossetti 1 Reply Last reply Jul 16, 2012, 5:51 PM 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

                    • CREW-MARKETING

                      Quick Fix to "Duplicate page without canonical tag"?

                      When we pull up Google Search Console, in the Index Coverage section, under the category of Excluded, there is a sub-category called ‘Duplicate page without canonical tag’.  The majority of the 665 pages in that section are from a test environment. If we were to include in the robots.txt file, a wildcard to cover every URL that started with the particular root URL ("www.domain.com/host/"), could we eliminate the majority of these errors? That solution is not one of the 5 or 6 recommended solutions that the Google Search Console Help section text suggests.  It seems like a simple effective solution.  Are we missing something?

                      Technical SEO | Nov 13, 2018, 1:07 PM | CREW-MARKETING
                      1
                    • lina_digital

                      I am trying to generate GEO meta tag for my website where on one page there are multiple locations My question is, Can I add GEO tagging for every address?

                      Am I restricted to 1 geo tag per page or can i add multiple geo tags ?

                      Technical SEO | Jan 17, 2018, 4:49 PM | lina_digital
                      0
                    • znotes

                      Do you need a canonical tag for search and filter pages?

                      Hi Moz Community, We've been implementing new canonical tags for our category pages but I have a question about pages that are found via search and our filtering options. Would we still need a canonical tag for pages that show up in search + a filter option if it only lists one page of items? Example below. www.uncommongoods.com/search.html/find/?q=dog&exclusive=1 Thanks!

                      Technical SEO | Oct 7, 2016, 9:18 PM | znotes
                      0
                    • RickyShockley

                      Home Page Ranking Instead of Service Pages

                      Hi everyone! I've noticed that many of our clients have pages addressing specific queries related to specific services on their websites, but that the Home Page is increasingly showing as the "ranking" page. For example, a plastic surgeon we work with has a page specifically talking about his breast augmentation procedure for Miami, FL but instead of THAT page showing in the search results, Google is using his home page. Noticing this across the board. Any insights? Should we still be optimizing these specific service pages? Should I be spending time trying to make sure Google ranks the page specifically addressing that query because it SHOULD perform better? Thanks for the help. Confused SEO :/, Ricky Shockley

                      Technical SEO | Feb 24, 2016, 5:02 AM | RickyShockley
                      0
                    • Nanook1

                      Is it better to use XXX.com or XXX.com/index.html as canonical page

                      Is it better to use 301 redirects or canonical page? I suspect canonical is easier. The question is, which is the best canonical page, YYY.com or YYY.com/indexhtml? I assume YYY.com, since there will be many other pages such as YYY.com/info.html, YYY.com/services.html, etc.

                      Technical SEO | Jan 2, 2015, 7:27 PM | Nanook1
                      0
                    • ztalk112

                      301 redirect: canonical or non canonical?

                      Hi, Newbie alert! I need to set up 301 redirects for changed URLs on a database driven site that is to be redeveloped shortly. The current site uses canonical header tags. The new site will also use canonical tags. Should the 301 redirects map the canonical URL on the old site to the corresponding canonical for the new design . . . or should they map the non canonical database URLs old and new? Given that the purpose of canonicals is to indicate our preferred URL, then my guess is that's what I should use. However, how can I be sure that Google (for example) has indexed the canonical in every case? Thx in anticipation.

                      Technical SEO | Nov 10, 2014, 8:08 PM | ztalk112
                      0
                    • JohnBerger

                      Rel = prev next AND canonical?

                      I have product category pages that correctly have the prev next but the moz crawl is giving me duplicate content errors.  I would not think I also need to have canonical - but do I ?

                      Technical SEO | Sep 26, 2012, 12:09 PM | JohnBerger
                      0
                    • LarsEriksson

                      Hreflang on non-canonical pages

                      Hi! I've been trying to figure out what is the best way to solve this dilemma with duplicate content and multiple languages across domains. 1 product info page 2 same product but GREEN
                      3 same product but RED
                      4 same product but YELLOW **Question: ** Since pages 2,3,4 just varies slightly I use the canonical tag to indicate they are duplicates of page 1. Now I also want to indicate there are other language versions with the_ rel="alternate" hreflang="x" _element. Should I place the _rel="alternate" hreflang="x" _on the canonical page only pointing to the canonical page with "x" language. Should I place the _rel="alternate" hreflang="x" _on all pages pointing to the canonical page with the "x" language? Should I place the _rel="alternate" hreflang="x"  _on all pages and then point it to the translated page (even if it is not a canonical page) ? /Lars

                      Technical SEO | Apr 5, 2012, 5:01 PM | LarsEriksson
                      0

                    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.