Keywords Condition

By  AdPresso
Last updated March 25, 2026

Context matters. What your users read at any given moment determines what feels relevant and what gets ignored. The Keywords condition lets you align ad delivery with that context by checking whether a specific term appears on the page.

Instead of manually assigning ads, you use your content as the trigger. The condition evaluates the article in real time and decides if an ad should load based on defined keywords. 

How to use the Keywords condition

Keyword targeting works best when it connects content with a clear user intent. Instead of hardcoding ads into specific posts, you define triggers once and let AdPresso handle the matching across your entire site.

You can apply the condition to individual ads, ad groups, or entire placements.

  1. Open the item you want to configure.
  2. Navigate to the Conditions section.
  3. Add a new condition and select Keywords.
  4. Enter a keyword and choose the operator, e.g., "contains".
  5. Save your changes.

The item will now load only if the keyword logic matches the page content. If you want to target multiple keywords, add additional keyword conditions separately or use a regex pattern (see detailed examples below).

For a broader explanation of how to use conditions in AdPresso, see the general conditions documentation.

Example: Contextual affiliate targeting for lever espresso machines

In this example, we focus on a product-driven scenario around lever espresso machines.

Let’s assume you run a coffee blog and have an ad group with various affiliate creatives. Your audience is naturally split into different interest groups. Some readers value manual craftsmanship, while others prioritize automated convenience. Since your blog covers both, you want to ensure your ads align with readers' current mindset. A reader looking for high-tech automation is unlikely to click on a manual lever machine. 

By targeting specific keywords and excluding opposing ones, you reach the right segment at the right time, which significantly increases your relevance and conversion rates.

Setup

  1. Open your existing ad group or create a new ad.
  2. Select the ad that promotes lever espresso machines.
  3. Navigate to the Conditions section of this ad.
  4. Add the Keywords condition.
  5. Enter "lever espresso machine" and set the operator to "contains".
  6. Add another Keywords condition combined with AND to exclude the opposing interest group.
  7. Enter "super-automatic" and set the operator to "does not contain".
  8. Save the ad.

Make sure the ad is assigned to your ad group and that the group is already connected to an active placement. Your existing setup handles the placement and rotation, while the Keywords condition ensures contextual relevance.

From this point on, the ad will automatically appear in all content that includes the targeted keyword, but AdPresso prevents it from appearing in articles focused on push-button convenience. You can repeat the same logic for additional products, categories, or intents and gradually build a system that maps your content to the most relevant ads.

Advanced keyword targeting with RegEx for dynamic content matching

Standard keyword targeting works well when you know exactly which terms you want to match. However, real-world content is rarely that uniform. Authors use different spellings, varying formats, or technical shorthand.

This is where RegEx (Regular Expressions) comes into play. Instead of matching a single, static word, you define a pattern. The Keywords condition then checks if the content fits that logic. This allows you to cover entire topic clusters with a single, smart rule.

Think of RegEx as a set of flexible instructions. Instead of looking for an exact word, it looks for a pattern. For example, if you want to support both British and American English, you can use the Optional Character (?). 

The pattern Colou?r tells the system that the "u" is optional, so it matches both "Color" and "Colour". 

Here are a few simple examples:

  • The Optional Character (?): Colou?r matches both "Color" and "Colour".
  • The "OR" Operator (|): Coffee|Espresso matches either "Coffee" or "Espresso".
  • The Space Handler (\s?): 58\s?mm matches "58mm" and "58 mm".

Example: Targeting multiple keywords with RegEx

If your ad is relevant to an entire category rather than a single product, you can use the OR operator (|) to match multiple terms at once. This is much faster than creating separate conditions for every single keyword.

For example, you want to show an ad for "Barista Accessories" on any page that mentions core brewing tools like tampers, pitchers, or scales.

The RegEx Pattern could look like this one:

\b(tamper|pitcher|scale)\w*\b

This single line acts as a net. Because of the \w* wildcard, it automatically catches both singular and plural forms (like "tamper" and "tampers") as well as variations like "scaling", ensuring your ad appears across all relevant equipment guides without any extra manual work.

Example: The E61 "prosumer" ecosystem

A perfect example of this power is the E61 brew group. It is a technical standard used across dozens of high-end espresso machine brands. Readers engaging with this topic are typically "prosumers"—enthusiasts who are likely to invest in premium upgrades such as precision filter baskets or bottomless portafilters.

Rather than maintaining a list of 50+ brand names, you can use one RegEx pattern to detect any article mentioning this specific technology and its related tools. The goal is to automatically inject ads for premium accessories (58 mm) whenever a page indicates high-end espresso content.

Setup

  1. Open your ad and navigate to the Conditions section.
  2. Add a Keywords condition and select the "matches RegEx" operator.
  3. Enter this pattern: \b(E-?61|58\s?mm|portafilter\w*)\b
  4. Save the ad.

Breaking down the RegEx pattern

ComponentFunctionExample Result
\b ... \bWord Boundary: Ensures only whole words are matched.Matches "58mm", but ignores "158mm".
E-?61Optional Hyphen: The ? makes the preceding character optional.Matches both "E61" and "E-61".
|OR Operator: Tells the system to look for any of these terms.Matches either "E61", "58mm", or "portafilter". 
\s?Optional Space: Handles different spacing styles.Matches "58mm" and "58 mm".
portafilter\w*Wildcard: Catches any additional letters following the word.Matches "portafilter" and "portafilters".

This method creates a flexible targeting layer. Instead of reacting to individual words, you define the structure of what matters. It scales naturally because you can group entire technical concepts into a single condition.

Always test your RegEx with a few sample articles before going live to ensure you aren't accidentally matching unwanted terms.

Recommended tools

Use Regex101.com to test your patterns. Just paste your article text into the "Test String" field and see your RegEx highlight the matches in real-time.

You don't need to be a RegEx expert. You can use LLMs like Gemini or ChatGPT to generate these patterns for you. 

Simply ask: 

"Create a RegEx pattern that matches 'E61' with and without a hyphen, '58mm' with and without a space, and the word 'portafilter' including its plural."

This is AdPresso

Streamlined WordPress ad management, built on 15 years of expertise for serious monetization.
Features robust protection, targeting, A/B testing, diverse placements, and insightful tracking to spark your full revenue potential.

BlogStudies
AdPresso Logo