Adding Rel Canonical to multiple pages
-
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
-
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.
-
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
-
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.
-
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.
-
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.
-
Following the same concept:
- Create a column (Column E) with the following information "then another column (Column F) with ""/>"
- 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.
-
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
-
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:
- Create three more columns with to duplicate columns B, C, D
- Use the following formula on column B "**=CONCATENATE(A1,B1)" **
- Copy the same formula for columns C & D
- Replace the “B1” in your formula for the respective columns (i.e. Column C should have C1.)
- Copy & Paste the content of columns E, F, G (The copied columns with formulas) to all the rows.
- Once copied, the information in columns E, F, G should look like the end result that you want.
- 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.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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.
Related Questions
-
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 | | lina_digital0 -
Invert canonicals?
Hi, We have 2 sites, site A and site B. For now, some of our articles are duplicated on site B with rel canonicals towards site A. Starting now, Site B will be the main site for this category, we'll only post the content on this site. We will keep the old content on site A. But what do you think will happen if we invert the canonicals for the old articles? They would go towards site B. Would google eventually update its index, a bit like it would do for a redirect? Thanks !
Technical SEO | | AdrienLargus0 -
Rel=canonical redirect form sign-up to homepage
hi guys, just an idea- in our product- TrackTest.eu we have couple of authoritative websites linking directly to our Sign-up page. Does it make sense to use rel=canonical on Sign-up page with pointing to the homepage so we will pass some link juice to homepage ? I understand that it is not a use how was canonical designed (it is not duplicated content) and don't want to screw anything. Thanks
Technical SEO | | tracktest.eu0 -
Canconical tag on site with multiple URL links but only one set of pages
We have a site www.mezfloor.com which has a number of Url's pointing at one site. As the url's have been in use for many years there are links from many sources include good old fashioned hard copy advertising. We have now decided that it would be better to try to start porting all sources to the .co.uk version and get that listing as the prime/master site. A couple of days ago I went through and used canonical tags on all the pages thinking that would set the priority and that would also strengthen the page in terms of trust due to the reduced duplication. However when I went to scan the site in MOZ the warning that the page redirects came up and I am beginning to think that I need to remove all these canonical tags so that search engines do not get into a confused spiral where we loose the little page rank we have. Is there a way that I can redirect everything except the target URL without setting up a separate master site just for all the other pages to point at.
Technical SEO | | Eff-Commerce0 -
Rel canonical between mirrored domains
Hi all & happy new near! I'm new to SEO and could do with a spot of advice: I have a site that has several domains that mirror it (not good, I know...) So www.site.com, www.site.edu.sg, www.othersite.com all serve up the same content. I was planning to use rel="canonical" to avoid the duplication but I have a concern: Currently several of these mirrors rank - one, the .com ranks #1 on local google search for some useful keywords. the .edu.sg also shows up as #9 for a dirrerent page. In some cases I have multiple mirrors showing up on a specific serp. I would LIKE to rel canonical everything to the local edu.sg domain since this is most representative of the fact that the site is for a school in Singapore but...
Technical SEO | | AlexSG
-The .com is listed in DMOZ (this used to be important) and none of the volunteers there ever respoded to requests to update it to the .edu.sg
-The .com ranks higher than the com.sg page for non-local search so I am guessing google has some kind of algorithm to mark down obviosly local domains in other geographic locations Any opinions on this? Should I rel canonical the .com to the .edu.sg or vice versa? I appreciate any advice or opinion before I pull the trigger and end up shooting myself in the foot! Best regards from Singapore!0 -
Why is the Page Authority of my product pages so low?
My domain authority is 35 (homepage Page Authority = 45) and my website has been up for years: www.rainchainsdirect.com Most random pages on my site (like this one) have a Page Authority of around 20. However, as a whole, the individual pages of my products rank exceptionally low. Like these: http://www.rainchainsdirect.com/products/copper-channel-link-rain-chain (Page Authority = 1) http://www.rainchainsdirect.com/collections/todays-deals/products/contempo-chain (Page Authority = 1) I was thinking that for whatever reason they have such low authority, that it may explain why these pages rank lower in google for specific searches using my exact product name (in other words, other sites that are piggybacking of my unique products are ranking higher for my product in a specific name search than the original product itself on my site) In any event, I'm trying to get some perspective on why these pages remain with the same non-existent Page Authority. Can anyone help to shed some light on why and what can be done about it? Thanks!
Technical SEO | | csblev0 -
Am I Doing this Canonical Right?
Hi,I admit to new to the Mod Rewrite.Here is my mod rewrite in my .htaccess# Begin non-www page protection # <ifmodule mod_rewrite.c="">RewriteEngine On
Technical SEO | | Force7
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]</ifmodule> # End non-www page protection #If I have my home page set toI really want the canonical to be www.domain.com no trailing slashDid I create a confllict, and if so, how should I change it?0 -
301 lots of old pages to home page
Will it hurt me if i redirect a few hundred old pages to my home page? I currently have a mess on my hands with many 404's showing up after moving my site to a new ecommerce server. We have been at the new server for 2 years but still have 337 404s showing up in google webmaster tools. I don't think it would affect users as very few people woudl find those old links but I don't want to mess with google. Also, how much are those 404s hurting my rank?
Technical SEO | | bhsiao1