Clear search
Close search
Google apps
Main menu

Enhance your organization's website even more with Google Site Search.

Exclude boilerplate content

In general, the most relevant and useful content appears in the main body of webpage. Google is generally able to detect boilerplate content like copyright notices, headers, and footers, and doesn't take keywords found in those areas into account when calculating the relevance of a page to a user query.

However, it may not always be possible for Google to identify these areas. If your pages have regions containing boilerplate content that's not relevant to the main content of the page, you can identify it using the nocontent class attribute. When Google Custom Search sees this tag, we'll ignore any keywords it contains and won't take them into account when calculating ranking for your Custom Search engine. (We'll still follow and crawl any links contained in the text marked nocontent.) 

To use the nocontent class attribute, you'll need to tag the boilerplate content, and then modify your context file. This tells Google that you're using the nocontent class attribute.

First, include the boilerplate content in a tag (for example, span or div) like this:

<div class="nocontent">
  <!-- It's fine to combine class="nocontent" with other classes in this div -->
  <!-- The area to exclude -->


Next, update your context file as follows:

  1. On the Control Panel, on the left-hand menu, click Advanced.
  2. In the Download context section, click Download in XML format.
  3. Edit the downloaded context file cse.xml to add a new attribute enable_nocontent_tag="true" to the CustomSearchEngine tag. For example, change <CustomSearchEngine id="id" creator="id"> to <CustomSearchEngine id="id" creator="id" enable_nocontent_tag="true">.
  4. In the Upload context section, click Upload and upload the updated cse.xml file.

Using nocontent won't impact your site's performance in Google Web Search, or our crawling of your site, in any way. We'll continue to follow any links in tagged content; we just won't use keywords to calculate ranking for your Custom Search engine.