1

I have a requirement to challenge a visitor to accept the terms and conditions of the page they are viewing. If a user has not accepted the terms, it will be displayed on every page they visit, it will take the form of a JavaScript modal dialog but when js is not available it needs to be at the top of the page. When they accept, they will be cookied and the HTML for the challenge will not be output to the page.

Search engine spiders will never accept the terms and conditions and will therefore see the T&C copy on every page, vary near the top of the HTML source, and presumably index that for every page.

Is there a way to mark up an element to tell the spiders there is no useful information contained in this element, or "Please don't index this element"?

I guess this is kind of like reverse-cloaking. I want the SEs to ignore this legal jargon so that they can actually index the interesting content of the pages.

Alternatively, would it be considered cloaking, and as such incur a penalty if I hid this from the SEs based on user-agent?

2
  • 1
    Oh my God, just out of curiosity: who has proposed such terrible way to design the website? Is there any way you could talk this person into avoiding this disaster in usability?
    – user6113
    Apr 21, 2011 at 22:51
  • @Michal it is a legal requirement from the client. There is no room for maneuver. Please give me your thoughts on the SEO questions above, not the underlying design issues.
    – Greg B
    Apr 22, 2011 at 9:01

1 Answer 1

3

Is there a way to mark up an element to tell the spiders there is no useful information contained in this element, or "Please don't index this element"?

<script type="text/javascript">
  document.write('search engines will ignore this content');
</script>

Cloaking involves serving different content to requests which you have identified as search engine spiders; this method simply serves the same Javascript up to anyone who requests the page.

You might want to add a Javascript cookie check to skip display of the modal if the user has already accepted your T&CoS.

Would it be considered cloaking, and as such incur a penalty if I hid this from the SEs based on user-agent?

That is the most typical implementation of cloaking.


Update:

I state it needs to have an HTML fallback, pure js is out.

Sorry, I didn't see that mentioned in your question. Here's a rough implementation to consider:

Filesystem:

  • /robots.txt - include "Disallow: /iframe"
  • /iframe/terms.htm - content that you'd like to serve up in the modal

Example HTML doc:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- ... -->
<style type="text/css">
div#iframeWrapper {
    position:absolute;
    top:0;
    left:0;
    height:100%;
    width:100%;
    background-color:#EFEFEF;
}
iframe#terms {
    position:absolute;
    top:50%;
    left:50%;
    height:600px;
    width:800px;
    margin-top:-300px;
    margin-left:-400px;
}
</style>
<!-- ... -->
</head>
<body>
<p>Some content.</p>
<!-- IF COOKIE NOT SET -->
<div id="iframeWrapper">
<iframe id="terms" src="/iframe/terms.htm" width="800" height="600"></iframe>
</div>
<!-- EOF IF COOKIE NOT SET -->
</body>
</html>

Also, my second question is not about how to do the cloaking but weather it would be detrimental to the sites ranking

Google may never find out about it, but it is always better to err on the side of caution - a human might see that what you are doing is legitimate, however, cloaking detection (and penalty assignment) is most likely to be performed by an algorithm, so why risk it?

2
  • Thanks @danlefree, in my question I state it needs to have an HTML fallback , pure js is out. Also, my second question is not about how to do the cloaking but weather it would be detrimental to the sites ranking
    – Greg B
    Apr 22, 2011 at 9:07
  • @Greg - Updated answer with an alternative to Javascript
    – danlefree
    Apr 22, 2011 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.