5

I currently use Google custom search for my static site. When I use it, I sometimes get images next to the entry:

enter image description here

I think Google simply takes the first image in the article. But I would rather like it to take the featured image (which is most of the time not in the article at all, but much smaller than all images that are in the articles and shows the topic of the article much better).

How can I tell Google which image to use for the preview?

4

I believe this is what you are looking for - https://support.google.com/customsearch/answer/1626955?hl=en

You can specify thumbnail images as follows:

PageMap data in the section of your HTML page A thumbnail meta tag.

Using a PageMap

You can specify a thumbnail image by adding a PageMap (a block of code) to the section of your page. This content is invisible to users, but it can provide valuable information to Custom Search. Create a thumbnail DataObject for your thumbnail image, like this:

 <!--
   <PageMap>
     <DataObject type="thumbnail">
       <Attribute name="src" value="http://www.example.com/recipes/applepie/applepie.jpg"/>
       <Attribute name="width" value="100"/>
       <Attribute name="height" value="130"/>
     </DataObject>
   </PageMap>
 -->

(You can also use PageMaps to create actions and custom attributes.) Using a thumbnail meta tag

To specify a thumbnail image for a page, you can add a thumbnail meta tag to the section of the page, like this:

 <meta name="thumbnail" content="http://example/foo.jpg" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.