This page describes how to customize the result snippets for your own website. To render your customized snippets, you must add structured data to your webpages.
Custom Search helps users find the right page by showing them a snippet—a small sample of content that gives search users an idea of what's in the webpage. To learn more about snippets, see the Webmaster Central blog post on the anatomy of a search result. If you do not like the standard snippets created by the Custom Search algorithm, you can create your own snippets. You can showcase key information—such as image thumbnails, summaries, dates, authorship, ratings, and prices—directly in your snippets. Having the most relevant information in your search results makes the webpages in your site more compelling to your users.
The following figures demonstrate various ways you can customize the snippets in your search results.
Figure 1: Result snippet with rating, price range, and review.
Figure 2: Result snippet with formatting, links, image, and comparative information.
Figure 3: Result snippet that includes document types, authors, page views, and comments.
Figure 4: Richly formatted result snippet that provides multimedia access and buttons ("ADD TO CART").
Creating Rich Snippets with the Custom Search Element
Essentially, creating rich snippets involves the following steps:
- Provide structured data in your webpages.
When Custom Search is indexing your webpages, it recognizes and preserves the metadata.
- Fetch that structured data in the search results for your Custom Search Engine.
The Custom Search server can return the search results, along with the structured data, in XML or JSON format.
- Create a presentation layer to transform the structured data into formatted HTML.
- Use the Custom Search element to transform JSON output for presentation to the user. The Custom Search element provides you with a presentation layer in the form of data templates; the data templates documentation gives details on how to use this rendering method.
- Write your own custom presentation layer that transforms JSON data to HTML that is presented to the end user.
Structured data extraction is documented in more detail in the Structured Data page, and creating a presentation layer with the Custom Search element is documented in more detail at the Custom Search element page.
Exploring Other Features
Custom Snippets works well with several other Custom Search features:
- If you want to learn more about changing the order of your results, see Drilling Deeper into Search Results.
- If you want to learn more about what structured data Google supports, see Providing Structured Data.
- If you want to learn more about the Custom Search element, see Custom Search element documentation.