: Hiding content from search spiders 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
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?
More posts by @BetL925
1 Comments
Sorted by latest first Latest Oldest Best
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?
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.