With Advanced Ads Pro you can display or hide an ad only for users coming to your site from a specific url, e.g. affiliate program, Google search or your newsletter.

You don’t have to make any changes in order to display an ad on all browsers and devices.

To display an ad to a visitor coming from a specific url, search for the Visitor conditions metabox and add the referrer url condition.

Once you added the condition you can choose from various methods to check it.


Display ads only for visitors from Google

A very basic setup to display ads for visitors from Google only would be this one:

Advanced Ads condition url parameter google

Hide ads from direct visitors

You can also use the plugin to hide ads from direct visitors. Simply enter your url like in the example below (url here: example.com).

referrer from example.com

When the referrer doesn’t work

The referrer condition doesn’t work when the visitor…

  • the source link uses rel=”noreferrer” (now set by default in the WordPress editor, remove it in text mode)
  • entered the site URL in browser address bar itself.
  • visited the site by a browser-maintained bookmark.
  • visited the site as first page in the window/tab.
  • switched from a https URL to a http URL.
  • switched from a https URL to a different https URL.
  • has security software installed (antivirus/firewall/etc) which strips the referrer from all requests.
  • is behind a proxy which strips the referrer from all requests.
  • visited the site programmatically without setting the referrer header (searchbots!).


Many services like email newsletters or some url shorteners are secured, so setting the referrer doesn’t work for them. The best way to be sure this works is to manually set a link on an unsecured site.

What else you need to know

The referer url of the visitors is only stored for the current session. Next time he visits your site again through another url, this urls is checked.

No url is stored if the visitor came directly to your site. However, on the second page impression the first visited page is used as the referer url. You might use the behaviour for rules on direct visits.