10

In my site I have the page http://www.example.com/page.php , however, I have links leading to http://www.example.com/page.php#page so I want them not to be indexed or followed. Will it be correct to mark these links as

<a href="http://www.example.com/page.php#page" rel="noindex, nofollow"> 

Also, as a canonical meta tag on the same page I already have

<link rel="canonical" href="http://www.example.com/page.php" /> 

Thank you!!!

P.S: I ask if this syntax is right, not how Google works and what is its politic towards urls

Dimentica
  • 795
  • 2
  • 11
  • 30
  • Possible duplicate of [Do Google and Bing crawlers treat hash tags in URLs as GET parameters?](http://stackoverflow.com/questions/6370561/do-google-and-bing-crawlers-treat-hash-tags-in-urls-as-get-parameters) – Alon Eitan Feb 13 '17 at 20:17
  • I do not see how this answers my question "How to make the link with rel="noindex, nofollow" and is this syntax correct?" I do not ask how google examins urls – Dimentica Feb 13 '17 at 20:22
  • It's there in the answer _Your source is correct. __Everything after the hash tag (aka URL fragment) is typically ignored__. The reason being, the URL fragment is typically only used by the browser and doesn't cause additional information to be pulled from the server. So the content of the page should largely stay the same._ so unless you have an ajax crawlable website, google ignore the hash part of the url. So it doesn't look correct to me – Alon Eitan Feb 13 '17 at 20:27
  • So for you this article https://support.google.com/webmasters/answer/96569?hl=en where sign in is used is also not correct at all? – Dimentica Feb 13 '17 at 20:30
  • Oh for heaven's sake. Yes - For me this article is full of baloney. Good luck – Alon Eitan Feb 13 '17 at 20:41
  • I appreciate your view, thank you. For my regret, I cannot tell my SEO, who is certain he wants these tags, "this article is full of baloney", so maybe I have my reasons why I insist on this question – Dimentica Feb 13 '17 at 20:48
  • 1
    No, I was being sarcastic because you're showing me an article from Google webmasters in a replay and asking me if I think it's wrong. That article is CORRECT, what doesn't look correct to me is the use of hash (__#page__) and also a `rel="noindex, nofollow"` which _usually_ gets ignored by google ([reference](http://webmasters.stackexchange.com/questions/52401/how-does-google-treat-hash-fragment-inside-a-canonical-url)) - So I think that there is a chance that google will interpolate this as `` since hash part get ignored – Alon Eitan Feb 13 '17 at 20:55
  • 1
    Thank you! I see your point, I totally agree. However, despite everything, I already see in my mind how we use these tags on the site ... – Dimentica Feb 13 '17 at 21:06

1 Answers1

9

You have invalid syntax in "rel" attribute. It must contain list of white-space separated keywords - remove the comma.

The "nofollow" keyword is correct. The "noindex" keyword does not make sense.

Edit: Clarification on request.

Proper syntax would be

<a href="http://www.example.com/page.php#page" rel="noindex nofollow">

But having "noindex" on the link does not make sense because this keyword obviously pertains to the linked page so it must be defined there for the whole page (in target's page's meta tag or robots.txt). There can be many links pointing to that page and SE would not know which link is right to claim "noindex" on target page...

elixon
  • 1,123
  • 12
  • 15