Gabriel Simões
Gabriel Simões

Reputation: 11

Filter Google Custom Search for pages that contain a specific metatag

I have been trying to filter my google custom searches to pages that specifically contain a meta tag structured as ilustrated below:

<meta data-rh="true" id="meta-og-image" property="og:image" content="https://xxx.jpg"/>

When I get the JSON from GCS I can see the metatag as:

    "metatags": [
      {
        "og:image": "xxx.jpg",
        "theme-color": "#fff",...

is it possible to craft a GET command informing in the URL that only pages with that specific meta tag should be part of the results?

As google only returns 10 items per CGS request and the total numer of items found is much bigger than 1000, I need to filter the search itself instead of crawling through results.

Could´nt get it to work until now.

Thanks for the support!

Upvotes: 1

Views: 798

Answers (1)

Andy
Andy

Reputation: 507

A query like more:pagemap:metatags:og_image will return pages that that have an og:image metatag

Learn more: https://developers.google.com/custom-search/docs/structured_search

Upvotes: 3

Related Questions