Use of multiple googleoff googleon tags in one page

1,719 views
Skip to first unread message

robH

unread,
May 26, 2010, 9:16:13 PM5/26/10
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
I want to exclude the header and footer of page, but index the main
body content. Would this be the correct method?

<html>
..
<body>

<!--googleoff: all-->
#Exclude header and menu content on top
<!--googleon: all-->

#Main page content to be indexed

<!--googleoff: all-->
#Exclude content in footer
<!--googleon: all-->

</body>
</html>


Google's documentation only gives example of usage with pairs of
googleoff/on tags and they always open with googleoff and close with
googleon so the above would seem to be the way to exclude top and
bottom, but include the main page content. Would there be any issues
if we didn't use the final googleon given that there is no content
after it?

Rob

Dave Watts

unread,
May 26, 2010, 11:36:35 PM5/26/10
to google-search-...@googlegroups.com
> I want to exclude the header and footer of page, but index the main
> body content.  Would this be the correct method?
>
> <html>
> ..
> <body>
>
> <!--googleoff: all-->
>    #Exclude header and menu content on top
> <!--googleon: all-->
>
> #Main page content to be indexed
>
> <!--googleoff: all-->
>    #Exclude content in footer
> <!--googleon: all-->
>
> </body>
> </html>

Yes, that's correct.

> Would there be any issues if we didn't use the final googleon given
> that there is no content after it?

It should work, but I've never tried it. I'd stick with the approach
outlined above.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

brianb

unread,
May 27, 2010, 1:12:21 AM5/27/10
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
Yup that should work. Give it a quick try on a test page and you
should find out. :-)

Brian

robH

unread,
May 27, 2010, 9:18:28 PM5/27/10
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
Thanks

flguy2

unread,
Aug 1, 2012, 12:03:19 PM8/1/12
to Google-Search-...@googlegroups.com, google-search-...@googlegroups.com
Can you NEST tags, like this:

<!--googleon: index-->
#A bunch of stuff I wanted indexed
<!--googleoff: all-->
#Exclude some stuff from ALL in the the middle
<!--googleon: all-->
#Some other random stuff i still wanted indexed
<!--googleoff: index-->
#The start of some stuff I don't want indexed

JMarkham

unread,
Aug 1, 2012, 1:27:18 PM8/1/12
to Google-Search-...@googlegroups.com, google-search-...@googlegroups.com
Harking back to the question if it would matter whether you have the last googleon tag:  Yes, it matters.  I've had no end of indexing errors when the off/on tags are not arranged in a way that could be interpreted as well formed.  In other words, it appears that the indexing parser treats those comment tags as DOM elements, and so they must be well formed or the indexing can fail.  Let me assure you, finding this took extensive testing.  :)  This applies to v 6.14 and v6.02 that we were directly testing against, can't speak to other versions.

On the question of nesting, I have not been able to get nesting to work at all; my experience being that those tags seem to require existence in matching pairs to be effective (e.g. a googleoff:index paried with a googleon:index).  In your example, also, you start with a googleon, which won't work.  The off/on tags are an exclusion method, so you begin with turning indexing off, then turn it back on again later.  The above example, edited so it will work is:

#A bunch of stuff I wanted indexed - indexing automatically starts, so you don't need to turn it on

<!--googleoff: all-->
#Exclude some stuff from ALL in the the middle
<!--googleon: all-->
#Some other random stuff i still wanted indexed
<!--googleoff: index-->
#The start of some stuff I don't want indexed
<!--googleon: index-->


JMarkham

Kathy

unread,
Sep 10, 2012, 2:04:42 PM9/10/12
to Google-Search-...@googlegroups.com

Right now, we are not indexing right or left navigation but would like to grab the URL's to add to the index?  If we let it go, it will grab the right/left nav and put it in the snippet/summary.  Can we use the googleoff:snippet googleon:snippet without too much issue or  should we use the googleoff:all googleon:all?


Thanks. 

JMarkham

unread,
Sep 11, 2012, 11:52:13 AM9/11/12
to Google-Search-...@googlegroups.com
Hi Kathy,

Unless you want the anchor text to be associated with the target page, googleoff: all / googleon: all would be the best choice.  In almost all cases, any anchor text that should be searchable should also be present on the target page.


JMarkham


Reply all
Reply to author
Forward
0 new messages