Comments on: Ignoring specific content on a page /2006/07/28/ignoring-content/ Google Search Appliance and Google Mini development Fri, 14 Mar 2014 15:00:46 +0000 hourly 1 http://wordpress.org/?v=4.2.2 By: Michael /2006/07/28/ignoring-content/comment-page-1/#comment-2030 Fri, 03 Aug 2007 19:04:44 +0000 /2006/07/28/ignoring-content/#comment-2030 A great tip; thanks!

]]>
By: Danny Dawson /2006/07/28/ignoring-content/comment-page-1/#comment-113 Fri, 28 Jul 2006 16:48:34 +0000 /2006/07/28/ignoring-content/#comment-113 While this technique does seem to be the official method for excluding certain page content from appearing in GSA search results, there is another method which does not affect the amount of markup you serve to your regular visitors.

As a GSA administrator, you have control over the GSA’s user-agent string. Even though it’s generally not a good idea to rely on user-agent sniffing for content delivery, in this case you’re the one with control over how the client (your GSA) identifies itself. As such, if you assign a unique user-agent to your GSA, you can then sniff for it server-side and omit only the bits of content you don’t want the GSA to see.

For example, if you assign the user-agent “businessname-searchappliance”, you can use this php to omit content:
if ( !strstr($_SERVER[‘HTTP_USER_AGENT’], ‘businessname-searchappliance’) ){
// Content to omit goes in this block
}

]]>