Disabling Zaraz via Page Rules doesn't work

What is the name of the domain?

bmcars.pl

What is the error message?

The Zaraz Consent Mode modal appears even though Page Rules are configured to disable it

What is the issue you’re encountering

The Zaraz Consent Mode modal appears even though Page Rules are configured to disable it

What steps have you taken to resolve the issue?

I set the Page Rules to disable Zaraz:
bmcars.pl/?appointment_action*
Disable Zaraz

bmcars.pl/wp-login*
Disable Zaraz

bmcars.pl/wp-admin*
Disable Zaraz


When I test it in incognito, the Zaraz Consent Mode is still visible:


How can we solve it?

Screenshot of the error

Your browser URL is www.bmcars.pl, however your Page Rule only covers bmcars.pl which is a different hostname. Try changing your rule to match on *bmcars.pl (with a wildcard), then use Trace to confirm your updated rule is being invoked on the URL you’re testing correctly.

1 Like

Hi @ncano I applied the changes:


Then I tested it with Trace:

It looks like the only Rule that was triggered was the Cache:

But why was it triggered if it should only apply to the bmcars.pl/wp-admin?

The Page Rules were not triggered at all. Only the Cache.

How can we proceed?

@ncano do we have an update in this case?

Okay, so your rule seems to be applied correctly. When I visit https://www.bmcars.pl/wp-admin/, I don’t see any requests to https://www.bmcars.pl/cdn-cgi/zaraz/, confirming that Zaraz is disabled on that page:

However, when checking https://www.bmcars.pl/, I do see a request to https://www.bmcars.pl/cdn-cgi/zaraz/, meaning Zaraz is still loading on the main page:

From your Trace screenshot, the only rule invoked is your Page Rule. However, the rule appears under the name FPW Zaraz Enabled, even though the action applied is actually Disable Zaraz. This is a bug, and we will fix it.

One more thing: your cache rule cannot be triggered at all. It uses a filter ‘Hostname equals bmcars.pl/wp-admin*, but:

  1. the hostname condition only applies to the domain (not the path);
  2. operator “equals” requires exact match and doesn’t support wildcards.

Because of this, the rule will never match any requests. If you’re trying to apply a rule to bmcars.pl/wp-admin*, you’ll need to use URI Full wildcard http*://bmcars.pl/wp-admin* instead.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.