---
metadata:
  - name: generator
    content: Diplodoc Platform v5.64.0
alternate:
  - https://www.yandex.ru/dev/direct/doc/en/objects/negative-keywords.md
  - https://www.yandex.ru/dev/direct/doc/ru/objects/negative-keywords.md
  - href: https://www.yandex.ru/dev/direct/doc/en/objects/negative-keywords.md
    type: text/markdown
    title: Markdown version
  - href: https://www.yandex.ru/dev/direct/doc/en/llms.txt?revision=r21714029
    rel: describedby
sourcePath: en/dg/objects/negative-keywords.md
title: Negative keywords
description: Negative keywords prevent ads from being shown for unwanted queries. They can be set at the ad group and campaign levels.
---
> **Documentation Index:** Fetch the complete configuration index at https://www.yandex.ru/dev/direct/doc/en/llms.txt?revision=r21714029


# Negative keywords

There are several ways to set negative keywords. All methods can be used simultaneously.

- List negative keywords at the ad group level in the `NegativeKeywords` parameter and at the campaign level in the `NegativeKeywords` parameter.

- Create sets of negative keywords using the [NegativeKeywordSharedSets](https://yandex.com/dev/direct/doc/negativekeywordsharedsets/negativekeywordsharedsets.html) service. Enable sets of negative keywords at the ad group level by specifying the set IDs in the `NegativeKeywordSharedSetIds` parameter.
- Specify individual negative keywords (negative keywords that consist of one word) directly for a keyword in the `Keyword` parameter.

Moving negative keywords to the group or campaign level makes configuration easier and reduces the risk of exceeding the limit on keyword length (4096 characters).

If a negative keyword that is set on the group or campaign level is completely included in a keyword, the negative keyword isn't applied to this keyword.

For more information about negative keywords, see [Negative keywords](https://yandex.com/support/direct/keywords/negative-keywords.html) and [Negative keyword library](https://yandex.com/support/direct/keywords/negative-keywords-library.html) in Yandex Direct Help.
