google custom search exclude specific queries

1.5k views Asked by At

Does anyone know if it is possible to exclude specific queries from our website's Google Custom Search please? Not sites, just specific terms (not related to profanity).

Also, if it is possible... when people do search for the specific query we've blocked, would that still be reflected in our annual search quota or not?

Thanks for any advice!

1

There are 1 answers

0
Stef P On

Exclude Query Term [-] Description The exclude (-) query term restricts results for a particular search request to documents that do not contain a particular word or phrase. To use the exclude query term, you would preface the word or phrase to be excluded from the matching documents with "-" (a minus sign).

The URL-escaped version of - is %2D.

The exclude query term is useful when a search term has more than one meaning. For example, the word "bass" could return results about either fish or music. If you were looking for documents about fish, you could exclude documents about music from your search results by using the exclude query term.

You can also use the as_eq request parameter to exclude documents matching a particular word or phrase from search results.

Examples User input: bass -music Query term: q=bass+%2Dmusic https://developers.google.com/custom-search/docs/xml_results#internationalizing-queries-and-results-presentation