WPConsent Blog

Everything you need to know about the WPConsent plugin

How to Share Cookie Consent Across Subdomains in WordPress

How to Share Cookie Consent Across Subdomains in WordPress 

Short Answer

To share cookie consent across subdomains in WordPress, install the free WPConsent plugin on each site. Then turn on Shared Consent under WPConsent » Settings » Advanced and save. Do it on every subdomain. A visitor who makes a choice on one of your sites won’t see the banner again on the others, as long as every site uses the same cookie categories and Toggle Services setting.

Key Takeaways

  • By default, each WordPress site saves a visitor’s cookie choice for its own address only, so every subdomain asks again.
  • Shared Consent saves the choice on your main domain instead, so shop.example.com and blog.example.com read the same one.
  • It’s free, and you have to turn it on for every site that runs WPConsent.
  • If the banner comes back on every site, check that they all use the same cookie categories, the same Toggle Services setting, and (with Toggle Services on) the same services.

A lot of businesses run more than one WordPress site under the same name.

The shop lives on shop.example.com, the blog sits on blog.example.com, and maybe your help center has an address of its own, too.

But their browser treats each address separately, and each one keeps its own cookies.

So a visitor accepts cookies in your shop, clicks over to your blog, and gets the same cookie banner again.

We saw this on our demo coffee shop we use for our tutorials. It keeps its shop and its blog on two subdomains.

In this guide, we’ll show you how to share cookie consent across subdomains with one free setting in WPConsent. Then we’ll test it together, so you can see the banner stay away.


Use the table of contents below to navigate this article.


Subdomains are often treated as separate sites by browsers and servers. So when you see the cookie banner pop up on both, nothing is broken. Each site is simply keeping its own record.

When a visitor makes a choice, WPConsent saves it in their browser in a small file called a cookie.

By default, WPConsent saves that cookie for the exact site where the visitor made their choice.

So a choice saved on shop.example.com stays with shop.example.com.

When the visitor opens blog.example.com, that site looks for a saved choice, finds nothing it can read, and shows the banner all over again.

But browsers also let a site save a cookie on the main domain, example.com. Every subdomain of example.com can read a cookie saved there.

Shared Consent saves the visitor’s choice on your main domain, so every subdomain reads the same one.


Before You Start: What You Need (Free)

You can do all of this with the free version of WPConsent.

Here’s what you need:

  • Two or more WordPress sites that share one main domain. For example, shop.example.com and blog.example.com. Your main domain, example.com, doesn’t have to run WordPress itself. Neither of our two demo sites sits on it.
  • WPConsent on each site. Free or paid both work, and you can mix them. We tested it with a paid plan on our shop and the free plugin on our blog.
  • Admin access to each site, because you’ll change one setting in each.
  • The same consent setup on each site. Every site needs the same cookie categories and the same Toggle Services setting. WPConsent starts every site with the same three categories (Essential, Statistics, Marketing), so if you haven’t changed them, you’re set.

New to WPConsent? It’s the best free consent plugin for WordPress, and our guide on adding a cookie consent banner walks you through the install.

Already using another cookie plugin? Run one consent plugin per site, so visitors don’t see two banners.

⚠️ One limit

This only works within one main domain. Two different domains, like example.com and example.org, each keep their own choice.


The setup takes three steps.

Start with any of your sites. The order doesn’t matter, because every site needs the setting.

In your WordPress dashboard, go to WPConsent » Settings.

Then click the Advanced tab at the top of the page. You will find it next to the Settings, Cookies, and Languages tabs.

WPConsent settings page tabs with an arrow pointing to the Advanced tab
The Advanced tab sits between Languages and IAB TCF on the WPConsent settings page.

Next, scroll down to the last box on the page, Advanced Settings.

On the free version, you’ll pass two boxes marked as PRO features on the way. You don’t need either one here.

In the Advanced Settings box, turn on the Shared Consent toggle.

The toggle’s description reads: “Share cookie preferences across all subdomains. MUST be enabled on all subdomain sites using WPConsent.”

Here’s the toggle switched on.

WPConsent Advanced Settings box with the Shared Consent toggle switched on and outlined in red
Shared Consent is the second row in the Advanced Settings box, between Clarity Consent Mode and Respect Global Privacy Controls.

After that, click the Save Changes button at the bottom right of the page.

You don’t need to type your domain anywhere. WPConsent works it out from your site address when you save, and that includes two-part endings like .co.uk.

The row just below, Respect Global Privacy Controls, is worth a look while you’re here. It honors the privacy signal some browsers send on their own, and our Global Privacy Control guide covers it.

Shared Consent has to be on for every site that runs WPConsent, not just your first one.

A site with it off saves choices for its own address only. So a visitor who makes their choice there won’t carry it to your other sites.

To finish the setup, log in to each of your other sites and repeat Step 1. Open WPConsent » Settings » Advanced, turn on Shared Consent, and click Save Changes.

It’s also good practice to tell visitors that their choice covers all your sites.

A short line in your banner text or your cookie policy does the job. For example: “Your cookie preferences apply across our websites, including shop.example.com and blog.example.com.”

Now check that it works. You’ll need two of your sites.

Open a private or incognito window first. Your normal browser may already have a saved choice from earlier visits, and that can hide the banner even when the setting isn’t working.

In the private window, visit one of your sites. You should see your cookie banner.

Click Accept All. Here’s that banner on the Harbor & Pine shop.

Harbor and Pine coffee shop homepage with the WPConsent cookie banner at the bottom and an arrow pointing to Accept All
The cookie banner on the Harbor & Pine shop subdomain, the first site our test visitor opens.

Next, open your other subdomain in the same window.

Without Shared Consent, this is where the journal showed its own banner, even though the visitor had just accepted cookies on the shop.

Harbor and Pine Journal page showing its own cookie banner after the visitor already accepted on the shop
With Shared Consent off, the journal subdomain asks again, even right after the visitor accepted on the shop.

With Shared Consent on in both sites, the journal loads with no banner at all. It already has the visitor’s choice.

Harbor and Pine Journal page with no cookie banner after the visitor accepted on the shop
With Shared Consent on for both sites, the journal subdomain loads with no banner, because it reads the choice made on the shop.

If you see the same, you’re done.

It works in either direction, as long as all your sites use the same cookie categories and the same Toggle Services setting. A visitor who starts on your blog and clicks Reject won’t be asked again in your shop.

Want to see the saved choice itself? Your browser’s cookie list shows a cookie named wpconsent_preferences, saved on .example.com instead of the subdomain. Our guide to finding which cookies your site uses shows you where to look.


If your test showed a banner where you didn’t expect one, it’s usually one of these two things.

“I turned it on, but the other site still asks.”

First, check that Shared Consent is on in that site, too. It’s easy to switch it on and leave the page without clicking Save Changes.

If it is on and saved, clear that site’s cache.

A caching plugin can keep serving an older copy of your pages for a while, and that copy still carries your settings from before you turned Shared Consent on.

Most caching plugins add a clear or purge button to your admin bar.

If your host or a service like Cloudflare caches your pages too, clear that cache as well.

Then test again in a new private window.

“It worked, then the banner came back on every site.”

This happens when your sites don’t ask visitors about the same things.

Each site checks the saved choice against its own list of cookie categories. If a site expects a choice that the saved cookie doesn’t have, the site clears the saved choice and shows the banner again.

With Shared Consent on, there is only one saved choice. So once a site clears the choice, every subdomain loses it.

We hit this on Harbor & Pine. Our shop had Toggle Services turned on, so visitors could choose service by service. Our journal didn’t.

A visitor who accepted on the journal and then opened the shop got the banner again. Their journal choice was gone from both sites.

Harbor and Pine shop homepage showing the cookie banner again after the visitor accepted on the journal
The shop asked for per-service choices the journal never collected, so the banner came back.

Two settings cause it:

  • Different cookie categories. One site has a category the others don’t. You manage categories in the Cookie Categories row on the Settings tab under WPConsent » Settings.
  • Different Toggle Services settings. One site lets visitors manage consent by service, and the others don’t. Toggle Services is in the Cookies Configuration box on the Settings tab, and it’s off unless you’ve turned it on.

Here’s the Toggle Services row, switched off.

WPConsent Cookies Configuration settings with the Toggle Services row switched off and outlined in red
Toggle Services on the Settings tab. Set it the same way on every site.

To fix it, give every site the same cookie categories and the same Toggle Services setting.

If Toggle Services is on, every site also needs the same services. Each service counts as its own choice.

A site with no marketing cookies can still keep the Marketing category. It just has nothing under it.

Your visitors will be asked one more time. After that, their choice carries across all your sites.


No. Shared Consent works across subdomains of the same main domain, like shop.example.com and blog.example.com. It can’t reach separate domains like example.com and example.org, because browsers don’t let one domain read another domain’s cookies.

If a visitor changes their mind on one subdomain, does it change everywhere?

Yes. There is only one saved choice. So a visitor can update their cookie preferences on any of your sites. The new choice applies to all of them from the next page they load.

No. Consent logs are part of WPConsent’s paid plans, and each site keeps its own. A site logs the choices visitors make on that site. If a visitor accepts in your shop and then browses your blog, the record sits in your shop’s log.

How long does a shared choice last?

It lasts for the Consent Duration set on the site where the visitor last saved their choice. That’s 30 days unless you’ve changed it. You will find Consent Duration in the Cookies Configuration box on the Settings tab under WPConsent » Settings. Use the same Consent Duration on every site, so a choice lasts the same time wherever the visitor made it.


Your subdomains can now share one cookie choice instead of asking visitors the same question again.

Turn on Shared Consent for every site, make sure their consent settings match, then run the private-window test from Step 3 on your own subdomains.

Remember, sharing the choice is a convenience for your visitors, not a compliance step. Each site still needs its own banner, script blocking, and cookie policy set up. Our beginner’s guide to WordPress and GDPR compliance covers the rest.

Want one cookie banner that remembers your visitors’ choice across all your subdomains?
Get WPConsent for free →

Want consent logs, location-based banners, and more for each of your sites?
See WPConsent pricing →


Add A Comment


Popular Resources

Get free tips and resources right in your inbox, along with 90,000+ others

Follow Us