Select Page

How to Add Cookie Consent in Divi in Minutes: 2 Easy Methods

Team DiviFlash

Updated: October 24, 2026

Table of Contents

To add cookie consent in Divi, you can use a Divi-specific solution like DiviFlash or a general WordPress cookie consent plugin like CookieYes.

Both let you collect visitor choices and control non-essential tracking, but the setup and workflow are different.

In this guide, we will show how to add cookie consent in Divi with both methods, step by step.

Let’s start with the easier method.

Method 1: Add Cookie Consent in Divi With DiviFlash

DiviFlash Cookie Consent lets you collect visitor preferences and control when managed scripts and supported third-party content can load. You can also design the banner directly in the Divi Visual Builder.

Here is how to use it:

Step 1: Install and Enable Cookie Consent

  • Install or update DiviFlash to version 5.6.0 or later.
  • Then go to WordPress Dashboard > DiviFlash > Extensions, find Cookie Consent, turn it ON, and click Proceed.

Note: Cookie Consent extension is available only for Divi 5.

Step 2: Design the Cookie Banner

Click Design Cookies. This opens the default consent layout in the Divi Visual Builder. Use the Cookie Banner module to customize it.

From the Content tab, you can control:

  • Banner content: Title, text, policy links, short label and icon.
  • Buttons: Accept, Reject, Customize, Save and Close.
  • Layout & Behavior: Button placement, title position, page dimming, content push-down and dismissal behavior.
  • Preferences Panel: Category descriptions, layout, controls and panel behavior.
  • Reopen Button: Lets visitors return to their cookie preferences later.

The Design tab controls the banner, buttons, panel, category items, toggles, typography, spacing, borders, backgrounds and other visual settings.

Note: The Cookie Banner module is available only inside this consent layout. You can't add it to regular pages or posts.

Step 3: Choose the Consent Behavior

Open the General tab. Under Default Behavior, choose how managed non-essential scripts behave before a visitor makes a choice:

  • Opt-in: Keeps non-essential scripts blocked until the visitor allows the required category.
  • Opt-out: Allows scripts to run first and blocks them only after the visitor rejects the related category.

Then, choose the Re-consent Period: 3, 6 or 12 months. This also controls how long the visitor's consent cookie stays valid.

Note: Consent requirements vary by region. Check the rules that apply to your visitors before using Opt-out. 

Step 4: Set Up Cookie Categories

Open the Categories tab. DiviFlash includes four categories:

  • Necessary
  • Analytics
  • Marketing
  • Preferences

You can edit their labels and descriptions or add custom categories when needed by clicking on Add custom category.

Step 5: Scan and Categorize Scripts

Go to the Scripts & Embeds tab and click Scan Site Scripts.

Review the detected scripts and assign each one to the appropriate category. Select Not managed (always runs) for scripts you do not want Cookie Consent to control.

Note: Scripts added directly to theme files or header/footer code may be detected, but DiviFlash cannot block them.

Step 6: Block Third-Party Embeds

In the Scripts & Embeds tab, find and enable Block Embeds Until Consent to prevent supported content such as YouTube and Google Maps from loading before the required consent is given.

Then assign each provider to the right category under Embed Providers. If a provider is missing, add its hostname manually.

You can also customize the Embed Placeholder Text shown in place of blocked content, or leave it empty to use the default message.

Step 7: Configure Compliance Settings

Open the Compliance tab. Then you will see these settings:

  • Google Consent Mode: Shares visitors’ consent choices with supported Google services. It works with DiviFlash’s four default cookie categories, not custom categories.
  • Respect Browser Privacy Signals: Recognizes (GPC) and (DNT). If either is detected before the visitor makes a choice, only Necessary cookies are allowed and the banner is skipped.
  • Consent Version: Use Ask all visitors again when you want returning visitors to make a new consent choice after changing your cookie setup.
  • Consent Log: Stores server-side records of visitor consent choices, including selected categories, consent version, date, page URL and a salted IP hash.
  • Consent Records: When Consent Log is enabled, Consent Records shows the latest consent activity and lets you refresh, export, or clear the records

Note: The consent log stores up to 50,000 records and automatically removes the oldest entries when the limit is reached.

Step 8: Let Visitors Change Their Preferences

Visitors may want to change their cookie choices later. To allow this, enable the Reopen Button from Cookie Banner module > Content > Reopen Button.

You can also use your own Cookie Settings button or link. For a Divi element, go to Advanced > CSS ID & Classes and add difl-cc-open-preferences to the CSS Class field. Clicking it will reopen the preferences panel. 

Step 9: Save Changes and Test

Save your changes, then test the site in a private browser window. Make sure the banner appears, consent choices are saved, managed scripts follow those choices, and blocked embeds load only after the required category is allowed.

Method 2: Add Cookie Consent in Divi With CookieYes

CookieYes is one of the best WordPress cookie consent plugins that also works with Divi. Unlike DiviFlash, it lets you manage the cookie banner and consent settings directly from its dashboard.

Here is how to set it up:

Step 1: Install and Connect CookieYes

  • Go to WordPress Dashboard > Plugins > Add New, search for CookieYes, then install and activate it.
  • Connect your website to a CookieYes account to access the banner, cookie scanner, and consent settings.

Step 2: Customize the Cookie Banner

Open Cookie Banner in the CookieYes web app. Choose the banner layout, edit the content and button labels, and adjust the colors to match your website.

Step 3: Scan and Categorize Cookies

Go to Cookie Manager > Scan now. After the scan, review the detected cookies and make sure they are assigned to the correct category, such as Necessary, Functional, Analytics, Performance, or Advertisement.

Step 4: Configure Cookie Blocking

CookieYes automatically blocks many common third-party scripts until consent is given. If a script is not blocked automatically, go to Cookie Manager, add or edit the cookie, and enter its Script URL Pattern to block it until the required consent is given.

Step 5: Enable Google Consent Mode if Needed

Open the Google Consent Mode (GCM) tab in the CookieYes WordPress plugin and enable it. Review the default consent settings before publishing.

Step 6: Test the Setup

Open your website in a private browser window and check that the banner appears, Accept and Reject work, your choice is saved, and non-essential cookies follow that choice.

DiviFlash vs CookieYes: Which One Should You Use?

FeatureDiviFlashCookieYes
Best forDivi 5 usersGeneral WordPress sites
Banner designDirectly in Divi Visual BuilderCookieYes dashboard
Divi workflowFully integratedSeparate workflow
Script controlManage detected WordPress scripts by categoryCookie/script blocking
Third-party embedsBuilt-in blocking with placeholdersAvailable
Google Consent ModeBuilt inAvailable
Consent recordsBuilt in with CSV exportAvailable
Location-based rulesNoAvailable

FAQs

Does Divi Have Built-In Cookie Consent?

No. Divi can help create a cookie banner, but it does not include a complete built-in system for managing consent, blocking scripts, and storing visitor choices.

Does a Cookie Banner Automatically Block Cookies and Tracking Scripts?

No. The banner collects the visitor’s choice. The consent solution must also block or allow relevant scripts based on that choice.

Is Google Consent Mode Needed for Google Analytics on a Divi Site?

Not always. Google Consent Mode lets supported Google tags adjust their behavior based on consent, but it does not replace the cookie consent banner itself.

Does DiviFlash Generate a Cookie Policy?

No. DiviFlash handles cookie consent, but you still need to create and link your own cookie or privacy policy.

Final Thoughts

You can add cookie consent in Divi with either a Divi-specific plugin or a general WordPress cookie consent plugin.

If you use Divi 5, DiviFlash lets you design cookie banners and manage consent in one place. With 85+ modules and 25+ extensions, it’s also one of the must-have Divi plugins to consider.

On the other hand, CookieYes is a better fit if you want a dedicated cookie consent solution that works independently of Divi.

If you don’t use a plugin, you can build cookie consent with custom code. However, you’ll need to handle the banner, consent storage, script blocking, preference changes, and other consent logic manually.

Team DiviFlash

At DiviFlash, we are more than just a team – we are a collective of Dev Experts, Word Artists, Design Virtuosos, and Marketing Maestros, all united by our profound expertise in Divi and WordPress. Our mission is to provide you with accurate, insightful, and in-depth content aimed at enriching your understanding of Divi, WordPress, and the art of web design.

0 Comments

Submit a Comment

Save Up to 60% Before the Black Friday Sale Ends!

Get It Now