If your shop loads Google Analytics, a Facebook Pixel or any similar script, you are expected to ask the visitor first. The Cookie Notice shows the banner that asks, and records what the visitor answered so the rest of your site can act on it.
That last part is new. The notice used to only remember that it had been dismissed, in the browser’s local storage, which nothing else could read. Now the answer is kept in an ordinary cookie, so both your PHP code and your JavaScript can check it and leave a tracking script out of the page when the visitor said no.
Availability
The Cookie Notice is a module and it is on by default. It ships with Rey Core 3.3.0, so update the theme and the plugin before looking for the options below. If the section is missing completely, open Rey Theme › Modules and check that Cookie Notice is enabled there.
The banner itself stays off until you pick a style.
Where to find it
Go to Settings › General › Site Elements › Cookie Notice.
The settings
Select style
Turns the banner on and picks its shape. Disabled means no banner. Side box is a panel in the bottom corner, with room for a few lines of text. Minimal is a compact bar, best when your message is one short sentence.
Text
The message itself. It accepts HTML and shortcodes, so this is where you link your cookie policy page.
Rewrite the default sentence once you turn the Decline button on. It says that continuing to browse counts as agreement, which stops being true the moment a visitor can refuse.
Button text
The label of the accept button. ACCEPT by default.
Decline button
Adds a second button so the visitor can refuse. On by default, and worth leaving on: an answer that can only be yes is not really an answer, and in the EU refusing has to be as easy as accepting. Both buttons are styled the same on purpose, because making the refusal harder to notice is exactly what regulators look for.
Turn it off if a plain notice is enough for your case. The banner then behaves like it did before, except the acceptance is still recorded properly.
Decline button text
The label of the refuse button, DECLINE by default. It only appears when Decline button is on.
Background Color, Text Color
The two colors of the banner. Leave them empty to follow the theme’s own neutral colors.
What the answer actually does
When the visitor clicks either button, Rey stores a first party cookie called rey_cookie_consent. Its value is one word, accept or reject. It is set for the whole site, with SameSite Lax, and it lasts 180 days before the visitor is asked again.
From there you have three ways to react:
- In PHP,
reycore__cookie_consent()returns true only after an acceptance, so you can skip printing a script entirely. - In JavaScript, the
reycore/cookie_notice/consentevent fires on every page load once the answer is known, and again the moment the visitor clicks. - The older
reycore/cookie_notice/acceptedevent still fires, on acceptance only, so snippets you wrote against the previous version keep working.
Three things worth knowing
It does not block anything by itself. A tracking script hardcoded in your header still loads, whatever the visitor answered. The cookie tells you what they chose, and the two snippets below are how you act on it. Nothing happens automatically.
The answer is all or nothing. There are no per category choices, so a visitor cannot accept analytics while refusing advertising. If you need that, you need a dedicated plugin, see the last section.
Visitors who accepted the old notice are not asked again. The first time they come back, their old acceptance is converted into the new cookie. Everyone else sees the banner again, because there was no answer to carry over.
Example: keep the Facebook Pixel out until the visitor agrees
- In Settings › General › Site Elements › Cookie Notice, set Select style to Side box.
- Leave Decline button on.
- Rewrite Text to say that the site would like to use tracking cookies, and link your policy page.
- Save, then wrap your pixel in the PHP check from the next section.
- Open the shop in a private window. The banner appears after a moment, and the pixel is not in the page source.
- Click the accept button and reload. The pixel is now printed.
Had you clicked the decline button, the pixel would stay out of the page for the next 180 days.
For developers
Read the answer in PHP with reycore__cookie_consent(). It returns true only after an acceptance, so the script below is simply not printed until then.
add_action('wp_head', function(){
if( ! reycore__cookie_consent() ){
return;
}
// print your tracking script here
});There is also reycore__cookie_consent_status(), which returns accept, reject or an empty string, for when you need to tell a refusal apart from a visitor who has not been asked yet.
Careful with page caches: a cached page is shared between visitors, so a PHP check is only reliable on pages your cache plugin skips. In the browser there is no such problem, so prefer the event:
document.addEventListener('reycore/cookie_notice/consent', (e) => {
if( e.detail.accepted ){
// load your tracking script
}
});e.detail also carries status, holding accept or reject, and fromButton, which is true only when the visitor just clicked, as opposed to the answer being replayed on a later page load. The same event is available on jQuery.
To change how long the answer is remembered, filter it. The value is in days and anything above 365 is capped, because that is what most data protection authorities expect.
add_filter('reycore/cookie_notice/expiry', function(){
return 365;
});There is no built in way for a visitor to change their mind. If you need one, clear the rey_cookie_consent cookie from your own link and reload.
Put any of these in your child theme’s functions.php or in a snippets plugin, never in the parent theme, because a theme update will overwrite it.
When you need more than this
If you must offer per category choices, block third party scripts automatically, signal Google Consent Mode, keep a log of who consented to what, or show different rules per country, use a dedicated plugin such as CookieYes, Complianz or Real Cookie Banner, and switch the Rey banner off so you do not show two. This module is meant for shops that load a few known scripts and want a real answer behind them.

