How to Add a Cookie Consent Banner in WordPress?

This step-by-step guide will walk you through how you can create and add a personalized cookie consent banner for your WordPress site in minutes.

To begin with, sign up on WebsitePolicies or login if you already have an account.

Create a Cookie Consent Banner For Your WordPress Website

Step 1: From your dashboard, click on the “Cookie consents” dropdown button and choose “Consent banner.”

Legal policies page with a highlighted section for managing cookie consents including the consent banner.

Step 2: Configure your cookie consent banner using the “Configuration wizard” feature where you can customize the appearance and layout of your banner.

Highlighted configuration wizard section for setting up a cookie consent banner.

Step 3: Go to “Cookie Policy” under the “Configuration wizard.” Retrieve your website’s cookie policy link and paste it into the URL box. Then, type “Cookie Policy” into the link label box.

Configuration wizard section with "Cookie policy," URL box, and link label box highlighted in red.

Step 4: Select “Preview” to check how your cookie consent banner looks on your page. Once done, click “Save” then select the “Add to my website” button.

"Configure cookie consent banner" page with the "Add to my website," preview, and save button highlighted in red.

Step 5: Click “Copy to clipboard” to get the installation code and begin installing the cookie consent banner on your website.

Cookie consent banner plugin's installation instructions with the "Copy to clipboard" button highlighted in red.

Install a Cookie Consent Banner Via a Plugin

Step 1: Log in to your WordPress dashboard. On the left-hand menu, click “Plugins” and select the “Add New” button.

WordPress dashboard with the "Add New" plugin button highlighted in red.

Step 2: In the search box, type “Insert Headers and Footers” and look for the plugin by WPBrigade. Once you find it, install and activate the plugin.

WordPress plugins marketplace with the search box and "Insert Headers and Footers" plugin highlighted in red.

Step 3: After activation, go to “Settings” and select “WP Headers and Footers.” Paste the cookie banner consent installation code into the “Scripts in Header” HTML box.

WordPress WP Headers and Footers section with the "Script in Header" HTML box highlighted in red.

Step 4: Save the changes by clicking the “Save the Changes” button at the bottom of the page. Once done, refresh your website to see the cookie consent banner live on your WordPress site.

Install a Cookie Consent Banner by Editing Your Theme

Step 1: Log in to your WordPress dashboard. On the left-hand menu, go to “Appearance” and click “Theme File Editor.”

WordPress dashboard with "Appearance" and "Theme File Editor" button highlighted in red.

Step 2: From the editor page, select “Theme Header” on the right-hand panel. Paste the cookie consent banner’s installation code into the HTML box between the “<head>” and “</head>” tags.

WordPress code editor page with "Theme Header" button and <head> tags highlighted in red.

Step 3: Save the changes by clicking the “Update File” button at the bottom of the page. Once done, refresh your website to see the cookie consent banner live on your WordPress site.

WordPress code editor page with the "Update File" button highlighted in red.