Skip to content
GPLWP Guides

How to customize cookie consent banners on WordPress

Security Time About 30 minutes 6 steps Updated 15 Sep 2026

SECURITY
The short answer

Customize the banner text, buttons, colours and layout in the cookie-consent plugin that powers it, then use WordPress Additional CSS for finer design changes. Do not stop at appearance: verify that non-essential cookies and tracking scripts stay blocked until consent.

The route
  1. 01Audit the current banner first
  2. 02Open the consent settings
  3. 03Add the manual CSS changes
  4. 04Keep essential functions working
  5. 05Test every consent path
  6. 06Use a plugin for the fast route

What you need

  • Administrator access to WordPress
  • An active cookie-consent or consent-management plugin
  • Access to the site’s privacy policy
  • A private browser window and browser developer tools

Audit the current banner first

Open the site in a private window and note what the banner currently says, which buttons it shows, where it appears and whether visitors can reopen their choices. Write down the cookies and third-party services your site actually uses, such as analytics, advertising, embedded video or chat.

A banner that only changes its appearance is not enough. Non-essential cookies and tracking scripts should not run before the visitor gives the required consent, and withdrawing consent should be as easy as giving it.

Open the consent settings

In the WordPress dashboard, open the settings screen for the plugin that displays the banner. Look for sections named Banner, Content, Layout, Design, Appearance or similar. Plugin labels differ, so do not assume a setting exists just because another plugin uses that name.

Change the message, privacy-policy link, button labels, position, width, colours, typography and category labels there when those controls are provided. Keep an equally clear option to reject or use only necessary cookies; making acceptance more prominent can create compliance problems.

Add the manual CSS changes

If the plugin has no suitable design controls, add CSS without editing the theme’s original files. With a classic theme, use Appearance > Customize > Additional CSS. With a block theme, use the Site Editor’s Styles area and its Additional CSS option. WordPress stores these changes separately from the theme files, although switching themes can remove block-theme custom CSS.

Use your browser’s inspector to identify the banner’s real classes and states, then target those classes rather than guessing selector names. If you need CSS that belongs with a theme, put it in a child theme stylesheet and load that stylesheet correctly; direct edits to the parent theme can disappear during an update.

Keep essential functions working

Only classify cookies and scripts as necessary when the site genuinely needs them for a requested function, such as cart, login, security or language preferences. Do not block the script that opens the consent panel, the consent-management code itself, checkout functions or accessibility controls.

Automatic blocking can sometimes stop a whole JavaScript file when that file contains both necessary and non-essential behaviour. That can leave a shop, form or navigation broken, so separate those scripts or add the required exclusion in the consent tool instead of disabling blocking altogether.

Test every consent path

Clear the consent cookie or use a private window, load the site without clicking anything and inspect the browser’s Application or Storage area for cookies. Also check the Network and Console panels for analytics, advertising, heatmap, chat and embedded-media requests. Repeat the test after accepting all, rejecting non-essential cookies and saving a custom selection.

Test on mobile and desktop, with caching and performance optimisation enabled. If the banner does not appear, check whether an existing consent cookie, Do Not Track handling, page cache, script combination, security plugin or Content Security Policy is interfering. These are recurring causes of missing banners and broken blocking.

Use a plugin for the fast route

For most sites, the fast route is to use a consent plugin with built-in banner templates, text controls, category management, script blocking and a preferences panel. This avoids hand-building the consent storage, reopening control and blocking logic, but you still need to map your actual cookies and test the result.

Flexible Cookies Styles Addon is a suitable design-focused option when you already need styled consent templates for your site. It provides multiple consent-banner styles and GDPR-focused notices, so you can change the visual presentation faster than writing the banner layout yourself. Treat it as the presentation and consent-management route, then confirm that your analytics, advertising and embedded services are correctly blocked before consent.

The fast route

Let Flexible Cookies Styles Addon do it

Multiple styled consent templates for matching your site’s design while supporting GDPR-focused cookie notices.

Get Flexible Cookies Styles Addon

Sources

  1. ico.org.uk /media2/migrated/4027811/cookie-banner-concerns.pdf?utm_sour…
  2. ico.org.uk /media2/about-the-ico/documents/4032419/cookie-letters-proje…
  3. wordpress.org /documentation/article/customizer/?utm_source=openai
  4. developer.wordpress.org /themes/advanced-topics/child-themes/?utm_source=openai
  5. wordpress.org /support/topic/cookie-bot/?utm_source=openai
  6. wordpress.org /support/topic/cookie-banner-does-not-show-up/?utm_source=op…

Questions

Can I customise a cookie banner without a plugin?
You can style an existing banner with CSS, but WordPress does not provide a complete consent-management system for a normal self-hosted site by itself. A fully manual solution would need banner markup, consent storage, category handling, script blocking, withdrawal controls and testing. For that reason, use a plugin or a custom consent-management implementation rather than building only a coloured notice.
Where should I add CSS for a cookie consent banner?
Add it through Appearance > Customize > Additional CSS for a classic theme, or through the Site Editor’s Styles and Additional CSS area for a block theme. If the CSS is part of a larger theme customisation, use a child theme stylesheet. Do not edit the parent theme directly because updates can overwrite your changes.
Why does my customised cookie banner not appear?
The most common causes are an existing consent cookie, a cached page, browser privacy settings such as Do Not Track, a JavaScript conflict or a security plugin blocking the consent code. Check the site in a private window, clear page and object caches, inspect the browser console and review the consent plugin’s security settings. Some tools deliberately hide the banner when they interpret Do Not Track as a refusal.
Does changing the banner design make the site compliant?
No. Design changes do not prove that consent works. You must also ensure that non-essential cookies and tracking scripts do not run before consent, that rejection is available without extra difficulty, that the privacy information matches your actual services and that visitors can change their choice later. Test those behaviours in a clean browser session rather than relying on the banner’s appearance.
Why did accepting or rejecting cookies break my site?
Consent blocking may have stopped a JavaScript file that performs both essential and non-essential tasks. This can break checkout, menus, forms or embedded content even though the banner is working as configured. Identify the blocked resource, split its functions where possible or exclude only the essential part from blocking. Do not simply disable all script blocking, because that can make the banner decorative rather than protective.