Welcome to WebmasterWorld Guest from 34.229.24.100

Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Canonical Code Not Showing in Webmaster Tools.

     
8:49 pm on Apr 17, 2015 (gmt 0)

Junior Member

10+ Year Member

joined:Dec 11, 2006
posts: 198
votes: 0


Hey Guys,

I noticed something strange. When I have Google fetch one of my pages from my website in Google Webmaster Tools, and then I review and search for my canonical code, it's not found. But if I go to the page online and look at the source code, the canonical shows. Could it be in the wrong section of the page? Why wouldn't Google see it in Google Webmaster Tools?

PS - Actually happens for both my Wordpress site and Magento site. Normal?

Jeff

[edited by: vetofunk at 9:09 pm (utc) on Apr 17, 2015]

9:06 pm on Apr 17, 2015 (gmt 0)

Junior Member

10+ Year Member

joined:Dec 11, 2006
posts: 198
votes: 0


I also noticed something else. If you go to an internal page on our site and enter in the non-www version of it, it redirects you to the homepage. Shouldn't it redirect you to the www version of the same page instead? It this normal? Could it be causing any issues?
9:19 pm on Apr 17, 2015 (gmt 0)

Preferred Member

5+ Year Member Top Contributors Of The Month

joined:May 24, 2012
posts:648
votes: 2


Neither of those things is normal, assuming you mean this...

  • By "canonical code", you mean the <link rel=”canonical” href=”http://example.com/” /> tag within the html of the page

  • You set up wordpress with the site url set to the www version, and going to example.com/page redirects to http://www.example.com/ instead of http://www.example.com/page

    You have a messed up wordpress configuration, or got hacked, or...I'm not sure.

    I would start by disabling any seo, redirection, etc, plugins, and checking the site url [codex.wordpress.org] settings.

    If all looks good after that, then enable the plugins one at a time and see which one causes the issue.
  • 11:16 pm on Apr 17, 2015 (gmt 0)

    Preferred Member from GB 

    10+ Year Member Top Contributors Of The Month

    joined:July 25, 2005
    posts:406
    votes: 17


    @vetofunk, do you mean when you go to Fetch as Google -> Downloaded HTTP Response
    and then you look at the code and the canonical is not there?

    What do you see in the first 11 lines of the code? Particularly the HTTP/1.1 response code and the Link: line?
    3:31 am on Apr 18, 2015 (gmt 0)

    Senior Member from US 

    WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

    joined:Apr 9, 2011
    posts:15706
    votes: 813


    If you go to an internal page on our site and enter in the non-www version of it, it redirects you to the homepage. Shouldn't it redirect you to the www version of the same page instead? It this normal? Could it be causing any issues?

    Well, "normal" is a statistical word. Is it good and desirable? No, absolutely not; you should get redirected to the with/without version of the same page. But the problem is with your code, not with Google.

    The HTML that google sees should be identical to the HTML that an ordinary human sees. (CSS is a different issue.) Which version do you see if you use a user-agent spoofer and visit your own site claiming to be the Googlebot?
    12:41 pm on Apr 18, 2015 (gmt 0)

    Junior Member

    10+ Year Member

    joined:Dec 11, 2006
    posts: 198
    votes: 0


    Two different issues for what I can tell?

    Here is the canonical code that is in my source code:
    <link rel="canonical" href="http://www.domain.com/1-birthstone-fluted-bypass-shank-mothers-ring.html" />

    This is what comes standard on Magento websites. When I use the Fetch as Google tool and look at the code it retrieves, here the header code, but doing a search, the code above is not in it. If I use a header checker like Rex Swain, it shows it there, just not in Google's fetch tool. Strange?

    The other issue is with redirects. When you go to any non-www page within the site (directly putting it in the url bar), it auto-redirects you to the homepage. That can't be right? I am thinking my developer messed something up with the redirects?
    1:03 pm on Apr 18, 2015 (gmt 0)

    Senior Member from US 

    WebmasterWorld Senior Member netmeg is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

    joined:Mar 30, 2005
    posts:13012
    votes: 222


    Yes, your developer definitely did. Are you operating your WordPress within your Magento site, or is it separate?
    1:09 pm on Apr 18, 2015 (gmt 0)

    Preferred Member

    5+ Year Member Top Contributors Of The Month

    joined:May 24, 2012
    posts:648
    votes: 2


    If the bad redirects are happenening on both wordpress, and magento, I would suspect .htaccess has a bad rule.
    1:32 pm on Apr 18, 2015 (gmt 0)

    Junior Member

    10+ Year Member

    joined:Dec 11, 2006
    posts: 198
    votes: 0


    Two separate websites.

    Wordpress Site - Working fine redirect wise, but the canonical doesn't show up in Google Webmaster Tools
    Magento Site - Inner pages are redirecting to homepage
    6:58 pm on Apr 18, 2015 (gmt 0)

    Senior Member from US 

    WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

    joined:Apr 9, 2011
    posts:15706
    votes: 813


    Are they two entirely separate sites or is the Magento installation in a subdirectory inside a WP installation (or vice versa)? Please say you're talking about different domains-- that is, separate physical files-- where each of the two has an entirely separate htaccess.

    For external redirects to work as intended, they have to come before the WP/Magento/whatever-CMS part of your htaccess. This, in turn, means you'll probably have to say the words "RewriteEngine on" twice. (Looks silly but does no harm.) Look at the two htaccess files side by side and find the line that begins
    RewriteCond %{HTTP_HOST}
    Whatever the WP site has is correct, while the Magento site is incorrect. See if you can get them to match.

    There is almost certainly a plugin that will handle the redirection internally. But this kind of thing is wildly inefficient; it's better to do your own coding if you can.
    1:29 am on Apr 26, 2015 (gmt 0)

    Junior Member

    10+ Year Member

    joined:Dec 11, 2006
    posts: 198
    votes: 0


    Fixed the first issue with the redirects. Still confused about the canonical url not showing up in Google Webmaster Tools. It doesn't let me copy the FETCH BY GOOGLE code or I would post it below. If I look at the source code of the page, it shows the canonical. If I use the http viewer by Rex Swain, it shows the canonical url, but if I do a search through the code Google fetches, 'canonical' is not found.

    Here is the first part of code:

    HTTP/1.1·200·OK
    Date:·Sun,·26·Apr·2015·00:27:39·GMT
    Server:·Apache
    Expires:·Thu,·19·Nov·1981·08:52:00·GMT
    Cache-Control:·no-store,·no-cache,·must-revalidate,·post-check=0,·pre-check=0
    Pragma:·no-cache
    X-Frame-Options:·SAMEORIGIN
    Set-Cookie:·frontend=2a33bb23fe75f4add2c6c8ef2504829b;·expires=Sun,·26-Apr-2015·01:27:39·GMT;·path=/;·domain=www.'domain'.com;·HttpOnly
    Content-Type:·text/html;·charset=UTF-8
    Connection:·close
    Vary:·Accept-Encoding
    Transfer-Encoding:·chunked
    3:14 am on Apr 26, 2015 (gmt 0)

    Senior Member from US 

    WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

    joined:Apr 9, 2011
    posts:15706
    votes: 813


    That's just the response headers. It should be largely identical to what you'd see yourself using something like Live Headers in Firefox, except that Google's request headers probably say some specialized stuff about caching.

    :: shuffling papers ::

    Uh-oh, I really shouldn't let my header logs pile up on the server for a month, should I?

    Most-but-not-all Googlebot requests include the If-Modified-Since header, which may in turn influence any the caching- and expiration-related responses. But I note that the X-Frame-Options header comes through loud and clear.

    :: wandering off to figure out why If-Modified-Since is present in some requests but not all, which is an awfully interesting question but almost certainly nothing to do with the present thread ::