Automattic / Automattic/jetpack
Make the EU Cookie Widget Single-Instance Only
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
Reported in: p8oabR-cR-p2
> Adding multiple cookie banner widgets to either one sidebar location, or to multiple, results in a cookie message that can’t be dismissed

---
Possible solution:
Make the EU cookie banner single-instance only. If that's a feature provided by WP core, great. If not, perhaps we can use a static class property to track the number of times it's used and only output a single instance to avoid presentation issues.
**Having said that,** I do see it being desirable to allow for more than a single instance of the widget to be configured on the admin side. For example, if you've configured multiple sidebars and only one of those sidebars is ever actually displayed; i.e., there are plugins to show sidebars conditionally.
So what's important is that we only ever output a single instance of the widget. We should still allow the widget to be configured multiple times on the back-end.
Contributor guide
Research direction
No file, test, or entry point is named in the issue. Start by locating the EU cookie widget implementation and its rendering path, then reproduce the problem with multiple configured instances. Done means multiple admin-side configurations remain possible while only one cookie banner is output and can be dismissed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100