How to Show or Hide Your Campaigns on Specific Pages

OptinMonster makes it easy to show or hide your campaigns on specific pages using our Display Rules.

In this article, you’ll learn how to show or hide your campaigns on specific pages.

Before you start, targeting campaigns by URL Path is included with all subscription plans.

The URL path is a specific portion of a web page’s URL, but not the full URL. The URL path is the text after the domain and before any query arguments or anchors.
URL Structure

This article includes the following examples:

  • Show a campaign only on specific language pages when using the WordPress Multilingual (WPML) plugin
  • Display a campaign when the URL matches a specific pattern using RegEx

Configure Display Rules

When you create a campaign in OptinMonster you may want to show or hide it on specific pages of your site. This is easy to do using OptinMonster’s Display Rules.

To show or hide your campaign on specific pages using the URL path, follow these steps:

  1. Navigate to the Display Rules view in the campaign builder.
    Navigate to the Display Rules in the OptinMonster campaign builder.
  2. Next, when adding or editing a rule select Where (Targeting) from the left-hand list and select the Page Targeting option.
    URL Path targeting with OptinMonster.
  3. Configure the current URL Path options as desired using the operator and key fields.
    URL Path options.
    The following options are available for current URL path:

    • is any page
    • is the homepage
    • is not the homepage
    • exactly matches
    • does not exactly match
    • contains
    • does not contain
    • starts with
    • does not start with
    • ends with
    • does not end with
    • matches the pattern
  4. You can quickly add more URL Path conditions by selecting the (+) icon to the right.
    Add more URL Path conditions.
  5. Control if the conditions in the group must ALL be required, or only a single condition needs to be met by toggling the ANY/ALL option above the group.
    Configure the group conditions to be all required or only one.
  6. When you’re finished, Save the campaign.


Some example configurations are provided below to help get you started.

Show a campaign only on specific language pages when using the WordPress Multilingual (WPML) plugin.

The WordPress Multilingual (WPML) plugin makes it very easy to target campaigns based on the specific language being viewed using the Page Targeting rule in OptinMonster.

The WPML plugin will use a prefix in the URL Path to indicate the language, for example ‘en’ for English, ‘es’ for Spanish, ‘fr’ for French, etc.

To show a campaign only on English pages of your site you would add a Page Targeting condition, ‘current URL Path starts with en’.  Like this:

WPML url path targeting example in OptinMonster.

Display When the URL Matches a Specific Pattern Using RegEx

You can set a rule to show a campaign only on URLs that match a specific pattern using a Regular Expression, or RegEx for short.

“A regular expression is a pattern that the regular expression engine attempts to match in input text. A pattern consists of one or more character literals, operators, or constructs.” – Microsoft

In simpler terms, RegEx looks for characters: be it letters, numbers, or specific symbols to identify a pattern. The results permitted or revoked depend on whether the Input to the Regular Expression Engine matches the pattern being employed by the engine.

This rule is an inclusionary rule and you should look at the Display on Specific Pages section for how to set conditions. Then, you can check out our RegEx pattern matching guide for more information on how to use RegEx and create patterns.

Looking for more ways to target specific pages and visitors on your site? See how to target campaigns based on URL parameters and query arguments!


When adding a path to the page targeting field, I’m getting a message that says ‘Unnecessary URL components have been removed’

Depending on your setup, the Page Targeting rule cannot be used to target any part of a URL that comes after a ‘?’ or a “#’ in the URL path, such as ‘’, or ‘’ since these are URL parameters and anchor tags, respectively.

Instead, you will need to use the specific rules for targeting URL parameters and the rules for targeting anchor tags.

Get Started With OptinMonster Today!

BONUS: Done-For-You Campaign Setup ($297 value)
Our conversion experts will design 1 free campaign for you to get maximum results – absolutely FREE! Click here to get started →