Opencart is such a great platform......but this seems to be an area that is lacking.
I have read all of the forum posts......so please do not bash me for not looking.
Also......I know that there are several here that do not believe that duplicate content is an issue. So if you are in that camp....please do not bash me for that either.
If anyone has created a global solution.....please advise.
I would like to get this totally corrected prior to the beginning of my link building campaign.
And if you are not a believer in that.....please do not bash me either.
Regards,
Brian
Gun Dog Supplies Discount Pet Supplies
iGunDog Kennel Supplies
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
No bashing from me.
I believe that if you do not have full control over the incoming links or have many different variations of a page url, then canonical urls are the way to go (so says Matt Cutts @ google)
When it comes to canonical it is just a guide, (again as Matt Cutts says) Google can and will use another url if it views it to be better to the user.
I believe that I saw something on the roadmap that said is was due to be included in 1.5.0??? may be wrong though.
I wanted to have canonical URLs in the HTML code of all category pages... and I did this:
1) I took several lines from catalog/controller/product/product.php (those lines are responsible for adding canonical URL on product page I think)
Code: Select all
$this->document->links = array();
$this->document->links[] = array(
'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $this->request->get['product_id']),
'rel' => 'canonical'
);
Code: Select all
$this->document->links = array();
$this->document->links[] = array(
'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path']),
'rel' => 'canonical'
);
website: 23webdesign
projects: RC cars, víno
Code: Select all
$cat_paths = explode('_', $this->request->get['path']);
$current_cat = array_pop($cat_paths);
$this->document->links[] = array(
'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $current_cat),
'rel' => 'canonical'
);
Code: Select all
<link rel="canonical" href="http://www.example.com/index.php?route=product/product&product_id=28" />
I suppose you could do the same for category pages and leave off the sort so that the cononical link is always the same.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
Canonical URLs only need to be used when the same page shows up via different URLs. That is not a problem with categories, sub-categories or manufacturer pages unless you've done some strange mods to your site.
The only place it was ever a problem was product pages, and Daniel has fixed that, perfectly.
I do SEO for a living (well, some of it). There is nothing wrong with OpenCart's canonical URLs. It's pretty much perfect. Stop worrying and finding fault where there is none.
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
I don't think adding the sort order will be of any benefit to be honest. It's not really a crucial change in my opinion, but wouldn't hurt either
Anyway, I hardly care anymore, the search engines are pretty good at deciding what the canonical URL is. Matt Cutts said so himself. You should stop worrying about canonical URLs and get your on-page optimisation sorted - use Titles and Headings that include keywords and key phrases - that's the key to getting to the top of the results.
Stop worrying about canonical URLs - the only real problem OpenCart had was products in multiple categories. Daniel has fixed that.
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
For example if your category is "notebooks" under the category of computers then you can access the category either via
/notebooks/
or
/computers/notebooks/
so therefore just taking the last chunk of the path (the current category id) you can always assure it's the same canonical regardless of how you got there
It is never going to happen, so stop worrying about it.
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
I can see why products would appear in different categories or sub-categories. I really can't see why you would move a sub-category from one category to another. Categories and sub-categories aren't tangible. They are only organisational structures. You can put a product in several categories or sub-categories, but what is a sub-category? Would I want to move my /notebooks/ sub-category from /computers/ to /womens-dresses/? I'm not being naive - I just think you are making a problem where one doesn't exist.
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
Classic examle for you:
What if you have a store that sells just certain categories of clothing to begin with (t-shirts, shorts, jeans, etc etc), then branches out to sell other items like toys and electrical items, you would want to put them all in categories that are neatly arranged and move all of your clothing categories into a category called clothing. Now ALL of the clothing categories have moved
Based on your post above you say that having a "diluted" link means it's worse for SEO, but you now want your category links to be as long as possible, even if it's 10 links deep? Surely from what you say it would be better to have it as I've posted above, with just /category-name/ rather than /path/to/category-name/ since it's less diluted
Also I would like to point out that I didn't make this problem where it doesn't exists, I just posted the solution to a potential problem with the code posted by borys. You just seem to want to argue about something rather trivial. I really don't care either way if it makes it into the OC 1.5.0 release, and you shouldn't either. You don't have to upgrade if you prefer the cart as it is
It may not be the same for everbody, but I'm selling products, not categories. And a lot of my products show up on the first page of Google. I don't really care how the categories do in Google.
And that's my main point. OpenCart is great for getting your individual products high up in the SERPS as long as you optimise your product page well. No matter how you arrange your categories or sub-categories, your products will always have the same canonical URL. Move your products to a different category, or put them in mulitple categories - same canonical URL.
And routes to categories can be used positively for SEO, despite the loss of Page rank. I've got gifts on my site and they are split into sub-categories. So my URLs are /gifts/for-children/, /gifts/for-him/, /gifts/for-her/ etc. Do I want my pages indexed like that, or like /for-children/ etc.?
But I guess there will be people out there wanting to rank for a category such as "jeans" or "t-shirts". All I can say is good luck to them.
I think Daniel has sorted out the main problem that OpenCart (and almost every other CMS) has with duplicate content. And he's done a great job. If people want just /category-name/ then that's fine with me, I just don't think it's that important compared to well-optimised product pages.
Again, apologies.
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
Here's what I did:
1.) In catalog/view/theme/MyTheme/template/product/categorymail.tpl (your exact "category template" file may vary - our site has been customized),
I changed
Code: Select all
if ($products[$i]['subcategory'] == $width_category['subcategory_id']) { ?>
<td>
<a href="<?php echo $products[$i]['href']; ?>">
<img src="<?php echo $products[$i]['thumb']; ?>" title="<?php echo $products[$i]['name']; ?>" alt="<?php echo $products[$i]['name']; ?>" />
<br />
<?php echo $products[$i]['name']; ?>
</a>
Code: Select all
if ($products[$i]['subcategory'] == $width_category['subcategory_id']) { ?>
<td>
<a [b]rel="canonical"[/b] href="<?php echo $products[$i]['href']; ?>">
<img src="<?php echo $products[$i]['thumb']; ?>" title="<?php echo $products[$i]['name']; ?>" alt="<?php echo $products[$i]['name']; ?>" />
<br />
<?php echo $products[$i]['name']; ?>
</a>
Yay.
Now, 2 questions for the experts in the audience:
1.) Where else can these non-canonical URL's appear? I.e. is there any other way that Google can "detect" the ugly "product_ID" links?
2.) Can you think of any reason that this might hurt my SEO efforts?
I'm sorry, but you are doing work for no reason on a misunderstanding of how rel=canonical works.
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
open file - catalog/controller/product/category.php and find following line of code
Code: Select all
$this->document->setKeywords($category_info['meta_keyword']);
Code: Select all
$this->document->addLink($this->url->link('product/category', 'path=' . $path_id), 'canonical');
Users browsing this forum: Ahrefs [Bot], barnettgs and 121 guests