Exclude boilerplate content

In general, the most relevant and useful content appears in the main body of a 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:

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.
  1. On the Custom Search home page, select the site you want.
  2. Click Setup, and then click the Advanced tab.
  3. In the CSE context section, click Download (XML).
  4. 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">.
  5. Go back to the CSE context section of the Advanced tab, and click Upload XML file.
  6. Upload the updated cse.xml file.