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