Referrer Blocker

The Referrer Blocker lets you block visitors based on the website they came from (the HTTP referrer). This is available on Pro plans only.

What Is a Referrer?

When someone clicks a link to your store from another website, the browser sends the referring website’s URL along with the request. This is called the referrer (or referer). For example, if someone clicks a link on spam-site.com that leads to your store, the referrer is spam-site.com.

Blocking a referrer prevents visitors who arrive from that specific website from accessing your store.

Adding a Referrer Block

  1. Go to Referrer Blocker from your dashboard.
  2. Click Add Referrer Block.
  3. Fill in the modal:
    • Domain — The domain to block (e.g., spam-site.com). Do not include http://, https://, or www. — these are removed automatically. Required.
    • Match Type — How the domain should be matched (see below). Default: “Contains.”
    • Redirect page — Optional URL to redirect blocked visitors.
  4. Click Save.

Match Types

Contains (Partial Match)

Blocks any referrer that matches the domain or its subdomains.

Example: Blocking example.com with “Contains” will block visitors from:

  • example.com
  • sub.example.com
  • mail.example.com

Exact Match

Blocks only the exact domain specified. Subdomains are not blocked.

Example: Blocking example.com with “Exact” will block visitors from:

  • example.com

But will not block visitors from:

  • sub.example.com
  • www.example.com

Block Empty/Direct Referrers

A separate setting is available above the block list table in the Referrer Settings card:

  • Label: “Block empty/direct referrers”
  • Help text: “Block visitors who access your site directly (no referrer). This may block legitimate direct visitors.”

When enabled, visitors who access your store without any referrer (e.g., by typing your URL directly, using a bookmark, or from apps that strip referrer data) are blocked.

Warning: Enabling this may block legitimate customers who access your store directly. Use with caution.

This setting is independent of your individual referrer block entries and is saved separately.

Managing Referrer Blocks

Referrer blocks are displayed in a table with the following columns:

ColumnDescription
DomainThe blocked domain
Match TypeShows “Exact” or “Contains”
StatusToggle switch to enable or disable the block
ActionsEdit button to modify the block

Each block can be individually enabled or disabled. Disabled blocks remain saved but are not enforced on the storefront.

Duplicate Prevention

You cannot add the same domain with the same match type twice. If you try, an error message appears: “This domain is already blocked.”

How It Works on the Storefront

  1. When a visitor loads your store, Kedra Shield reads the document.referrer value from the browser.
  2. Same-origin check: If the referrer is from your own store (internal navigation), it is always allowed. Blocking never applies to visitors navigating within your store.
  3. Empty referrer check: If the referrer is empty and “Block empty/direct referrers” is enabled, the visitor is blocked.
  4. Referrer matching: The referrer domain is compared against each enabled entry:
    • Contains: Blocks if the referrer domain matches exactly or is a subdomain.
    • Exact: Blocks only if the referrer domain matches exactly (case-insensitive).
  5. If blocked, the visitor sees the block page or is redirected to the configured URL.
  6. If any error occurs during checking, the visitor is allowed through (fail-open design).

When to Use Referrer Blocking

  • Spam referral traffic: Block domains that send fake traffic to your store to inflate your analytics.
  • Competitor blocking: Prevent traffic from specific competitor referral links.
  • Unwanted affiliate traffic: Block referrals from unauthorized or low-quality affiliate sources.

Pro Plan Requirement

The Referrer Blocker is available exclusively on Pro plans. Free plan users see a warning banner:

“Referrer blocking is available on Basic plan and above. Upgrade to block traffic from specific websites and referrers.”

The Add Referrer Block button is disabled on the Free plan.

Next Steps