Zen Cart Logo
Forums / Search Engines / How to create canonical tag?

How to create canonical tag?

Views: 95

Results 1 to 10 of 10
10 Sep 2013, 8:37 PM
#1
rosanna avatar

rosanna

New Zenner

Join Date:
Jul 2012
Posts:
14
Plugin Contributions:
0

How to create canonical tag?

In my SEO audits, I'm told I need to put a canonical designation in the dynamically generated pages. From what I can see, this code must be pasted in the meta data area of a static page, so, if my pages are dynamically generated, where do I put it?
Thanks, Rosanna

10 Sep 2013, 8:50 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: How to create canonical tag?

Zen Cart already puts a canonical tag on all its pages. ... unless you've altered your template to no longer have that feature.

What's your URL?

11 Sep 2013, 5:52 PM
#3
rosanna avatar

rosanna

New Zenner

Join Date:
Jul 2012
Posts:
14
Plugin Contributions:
0

Re: How to create canonical tag?

Hi,
Thanks. My URL is video-tutorials.net.
Rosanna

11 Sep 2013, 5:56 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: How to create canonical tag?

Well, whoever set up your template didn't leave the ZC canonical stuff in it. Your html_header.php has been significantly altered from ZC defaults, and is missing that functionality's output.

Also, you've got this in there, which is probably not going to give you good results:```
<meta name="googlebot" content="noarchive"/>

11 Sep 2013, 6:01 PM
#5
rosanna avatar

rosanna

New Zenner

Join Date:
Jul 2012
Posts:
14
Plugin Contributions:
0

Re: How to create canonical tag?

Dr. Byte, thx. What does that code that you pasted in there do? Can you recommend what I should do to get the canonical attribute back; is this a function of restoring the right code from the default html_header.php?

11 Sep 2013, 6:14 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: How to create canonical tag?

rosanna:

What does that code that you pasted in there do?Best to talk to your SEO Audit folks, who are probably the ones who told you to put it there?

rosanna:

Can you recommend what I should do to get the canonical attribute back; is this a function of restoring the right code from the default html_header.php?Yes, There's a section (3-4 lines I think) in the original file that echoes out the canonical link.

11 Sep 2013, 6:19 PM
#7
rosanna avatar

rosanna

New Zenner

Join Date:
Jul 2012
Posts:
14
Plugin Contributions:
0

Re: How to create canonical tag?

Dr. Byte, many thanks. Kind regards, Rosanna

4 Oct 2013, 4:58 PM
#8
rosanna avatar

rosanna

New Zenner

Join Date:
Jul 2012
Posts:
14
Plugin Contributions:
0

Re: How to create canonical tag?

Why does html_header.php contain the line <meta name="robots" content="noindex, nofollow" /> ; doesn't this tell search engines to exclude the page from their results, and to not access any pages linked to by html_header.php?

4 Oct 2013, 5:59 PM
#9
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: How to create canonical tag?

rosanna:

Why does html_header.php contain the line <meta name="robots" content="noindex, nofollow" /> ; doesn't this tell search engines to exclude the page from their results, and to not access any pages linked to by html_header.php?

If that is the only line in the code, Yes it will. But on a stock Zen Cart there is also a line above that telling ZC on which pages to place the no index line

<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>

ROBOTS_PAGES_TO_SKIP is filled in the metatags.php language file, and contains by default the next:

// Define which pages to tell robots/spiders not to index
// This is generally used for account-management pages or typical SSL pages, and usually doesn't need to be touched.
  define('ROBOTS_PAGES_TO_SKIP','login,logoff,create_account,account,account_edit,account_history,account_history_info,account_newsletters,account_notifications,account_password,address_book,advanced_search,advanced_search_result,checkout_success,checkout_process,checkout_shipping,checkout_payment,checkout_confirmation,cookie_usage,create_account_success,contact_us,download,download_timeout,customers_authorization,down_for_maintenance,password_forgotten,time_out,unsubscribe,info_shopping_cart,popup_image,popup_image_additional,product_reviews_write,ssl_check,shopping_cart');
4 Oct 2013, 6:32 PM
#10
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: How to create canonical tag?

If I might add, if your html_header.php does not include the conditional cod that Design75 pointed out, then YES this will be problematic..

Sounds like all the way around your html_header.php file has been modified in a way that is NOT beneficial.. Probably because whoever modified it didn't understand the purpose of the code in this file??

rosanna:

Why does html_header.php contain the line <meta name="robots" content="noindex, nofollow" /> ; doesn't this tell search engines to exclude the page from their results, and to not access any pages linked to by html_header.php?

Design75:

If that is the only line in the code, Yes it will. But on a stock Zen Cart there is also a line above that telling ZC on which pages to place the no index line

<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?> <meta name="robots" content="noindex, nofollow" /> <?php } ?> ``` > > ROBOTS_PAGES_TO_SKIP is filled in the metatags.php language file, and contains by default the next: > ```php // Define which pages to tell robots/spiders not to index // This is generally used for account-management pages or typical SSL pages, and usually doesn't need to be touched. define('ROBOTS_PAGES_TO_SKIP','login,logoff,create_account,account,account_edit,account_history,account_history_info,account_newsletters,account_notifications,account_password,address_book,advanced_search,advanced_search_result,checkout_success,checkout_process,checkout_shipping,checkout_payment,checkout_confirmation,cookie_usage,create_account_success,contact_us,download,download_timeout,customers_authorization,down_for_maintenance,password_forgotten,time_out,unsubscribe,info_shopping_cart,popup_image,popup_image_additional,product_reviews_write,ssl_check,shopping_cart'); ```