Forums / Search Engines / Google Alternate page with proper canonical tag Error

Google Alternate page with proper canonical tag Error

Views: 76

Results 1 to 3 of 3
31 Dec 2023, 11:18 AM
#1
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,305
Plugin Contributions:
39

Google Alternate page with proper canonical tag Error

1.5.8 & php 7.3

I have been receiving reports recently... Likely a Google change, because the shop has been live without changes for a very long time, is well indexed & ranked. Google search console is giving me the "Alternate page with proper canonical tag" error.

Here is the reason

This url
index.php?main_page=product_info&cPath=67_645_118_676&products_id=37819

has the following canonical tag

 <link href="https://www.xxxxxx.com/index.php?main_page=product_info&[B]amp;[/B]products_id=37819" rel="canonical">

Although, this is the first time I've seen this, it exists on several sites I manage. The escaped ampersand in the url creates the difference. I have temporarily patched this by editing html_output line 98

from

$link = preg_replace('/&/', '&', $link);

to

$link = preg_replace('/&/', '&', $link);

for the sake of testing. I think this will likely need a patch, as the correct representation of an ampersand in a url is unescaped.

I chose this manor because the generated links for structured data are also fixed.

Any ideas?

~Melanie

31 Dec 2023, 11:47 AM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Google Alternate page with proper canonical tag Error

If you do a view source (on an un-altered site) all links will look like this. This is not a problem.

This message "Alternate page with proper canonical tag" means the canonical link doesn't include the cPath.
I have long wondered whether intra site links should be generated without a cPath to prevent this, and I've even had clients request this change.

Who knows what the right move is.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

1 Jan 2024, 8:53 AM
#3
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,305
Plugin Contributions:
39

Re: Google Alternate page with proper canonical tag Error

It looks like the reason for the "error" from Google is that 2 pages have different content but the same canonical declaration. Allegedly, Google will simply exclude the duplicate version and index the main version of the page. However, this error has been in webmaster tools for 6 months... so I guess not.