2

Is it possible to add a nofollow for the whole page instead of

rel="nofollow"

for every link?

I've got some profile pages where users can enter their contacts and other stuff which can be potentially spam, and I cba to alter the filters for wysiwyg data.

Anonymous
  • 4,692
  • 8
  • 61
  • 91
  • unless I'm missing the obvious, in the head – OJay Sep 25 '12 at 02:17
  • I guess... some meta tag is what I'm looking for, but I afraid the above will prevent the content from indexing at all, I'm afraid link no follow and robots no follow are quite different things. – Anonymous Sep 25 '12 at 02:22
  • Theres a difference between NOFOLLOW and NOINDEX in the meta tag http://www.dailybloggr.com/2008/07/dos-and-donts-with-the-might-nofollow-tag/ and http://support.google.com/webmasters/bin/answer.py?hl=en&answer=96569 FYI – OJay Sep 25 '12 at 02:26
  • oh I see, then that's the thing. So I guess the meta tag would override the particular rel attributes? I know there are quite a bit of different values that may be assigned to rel. – Anonymous Sep 25 '12 at 02:34
  • I would say that the meta tag overrides (although not sure how you could test that), and it appears that the rel="" (which came after the meta tag) on the a tags was to get around the all encompassing behaviour of the meta tag, give you a bit more control, but it seems to be all about which ones to NOT follow, not necessarily which ones TO follow. – OJay Sep 25 '12 at 02:37
  • So if I understand it correctly, if the user has a way to manipulate the rel attribute of their links we shouldn't much rely on the above meta tag? – Anonymous Sep 25 '12 at 02:39
  • If you want more granular control over which links to follow and which ones to not follow then I wouldn't use the meta tag, but your question was 'Nofollow for the whole page?' right? - Another link FYI http://googlewebmastercentral.blogspot.co.nz/2007/03/using-robots-meta-tag.html – OJay Sep 25 '12 at 02:43
  • Yup, its correct, no follow for the whole page is what I need. Just wanted to make sure that it is impossible to override this setting by manipulating the rel. – Anonymous Sep 25 '12 at 02:50
  • I would assume that you are meaning you don't want users to be able post a link, that has rel="FOLLOW" in it and override your meta tag. I would say that the meta tag would win. Although again not sure how you could test that. If you have some server side language involved you could 'sanitise' any user submitted content and clean the links to be sure (i.e. remove any rel attributes). – OJay Sep 25 '12 at 02:56
  • Yup, I definitely can sanitize the input, I actually use htmLawed and do sanitize it for certain custom criteria, and yet it's not always a solution, as it takes some effort. I'm going to stick with a meta tag as it's the simplest way in my case, and it is exactly what I wanted. Thanks alot for the help! – Anonymous Sep 25 '12 at 04:09
  • Actually I found there is also an antispam parameter in htmLawed that creates rel=nofollow for matching the regex: `htmLawed($message, array('anti_link_spam'=>array('\`://(?!(mysite\.hn|forum\.mysite\.hn))\`', '')));` – Anonymous Sep 25 '12 at 04:53
  • I might add my comments as an answer, as It doesn't seem right to leave that answer as the only answer to this question – OJay Sep 25 '12 at 05:13

1 Answers1

7

Put this meta tag in the head

<meta name="robots" content="nofollow" /> 

Reference links:

OJay
  • 4,763
  • 3
  • 26
  • 47