views:

1217

answers:

8

Say that I write an article or document about a certain topic, but the content is meant for readers with certain prior knowledge about the topic. To help people who don't have the "required" background information, I would like to add a note to the top of the page with an explanation and possibly a link to some reference material.

Here's an example:

Using The Best Product in the World to Create World Peace

Note: This article assumes you are already familiar with The Best Product in the World. To learn more about The Best Product in the World, please see the official web site.

The Best Product in the World ...

Now, I don't want the note to show up in Google search engine results, only the title and the content that follows the note. Is there any way I can achieve this?

Also, is it possible to do this without direct control over the entire HTML file and/or HTTP response, i.e. on blog hosted by a third party, like Wordpress.com?

Update

Unfortunately, both the JavaScript solution and the HTML meta tag approach does not work on hosted Wordpress.com blogs, since they don't allow JavaScript in posts and they don't provide access to edit the HTML meta tags directly.

A: 

I just came to think of something. I guess I could render the note with JavaScript once the page is loaded?

Anders Sandvig
+2  A: 

Javascript. If you add your content to the site using javascript, it won't be picked up by the search engines. It's even appropriate, because you're enhancing the site, not providing additional content. Any other method of performing this will stick the content into the page. Even if you hide it using styling, it will still be in the text. Depending on your page structure, that might not be possible anyway.

Douglas Mayle
+4  A: 

You can build that portion of the content dynamically using Javascript.

For example:

<html>
<body>
  <div id="dynContent">
  </div>
   Rest of the content here.
</body>
<script language='javascript' type='text/javascript'>
  var dyn = document.getElementById('dynContent');
  dyn.innerHTML = "Put the dynamic content here";
</script>
</html>

If you're really stuck, you can just go old school and reference an image that has your text as part of it. It's not particularly "accessibility-friendly" though.

Paul Mrozowski
Argh. That would be the "perfect" solution, except Wordpress.com don't seem to allow <script> tags in their content... Not a big surprise, but still, impractical for me.
Anders Sandvig
The image would be a simple and effective solution.
cciotti
A: 

Hmm... maybe you can create a <div> with position: absolute; z-index: 99 (should be greater than 1); top: 0px; -- this should put the note at the top of the page but you could place the actual code near the bottom... search engines go linearly through the source and not by position I'd assume.

Edit: And this is fail if you decide you want it located somewhere else since this is an absolute location-- it'll just break down.. :\. go with the javascript

apandit
A: 

Any attempt to hide content is going to have side-effects regarding accessibility and compatibility. It seems that all you are attempting to do is control the snippet that search engines display, in which case you are better off providing an appropriate meta element description.

Jim
Well, I don't consider the note a part of the "content". It's only a added feature to help people.
Anders Sandvig
Using HTML meta tags is going to be a problem when I don't have access to directly control the generated HTML file myself (i.e. on a hosted blog).
Anders Sandvig
+1  A: 

You can try to improve the text that's shown on the search results page by providing a meta description tag. However, It's the search engine's prerogative to display whatever it chooses, which is not necessarily the first 'n' words on the page.

David Citron
A: 

I'm familiar with how WordPress.com works, but if you can put in stuff like Digg, Delicious badges on your blog as a third part added stuff.. then you might have a chance to do the same trick these badges uses, they inject dynamic content in your page , and you can figure how they are doing it and do the same with your custom content

Mohamed Faramawi
According to the official Wordpress.com FAQ (http://faq.wordpress.com/2006/05/07/javascript-can-i-use-that-on-my-blog/) they only allow JavaScript from specific, supported sites.
Anders Sandvig
+2  A: 

If you can use an iframe, then place the content on a static html page and use the meta tag in it's head to tell the search engines to ignore it. Since it's a seperate page, google etc.. should ignore it.

meta tag:

<meta name="robots" content="noindex, nofollow">
Sugendran