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
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,
div) like this:
<div class="nocontent"> <!-- It's fine to combine
class="nocontent"with other classes in this
div--> <!-- The area to exclude --> </div>
Next, update your context file as follows:
- On the Control Panel, on the left-hand menu, click Advanced.
- In the Download context section, click Download in XML format.
- Edit the downloaded context file cse.xml to add a new attribute
CustomSearchEnginetag. For example, change
<CustomSearchEngine id="id" creator="id">to
<CustomSearchEngine id="id" creator="id" enable_nocontent_tag="true">.
- In the Upload context section, click Upload and upload the updated cse.xml file.
nocontentwon'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.