Hello Sunil
How to add a cookie banner on your WordPress website

How to add a GDPR cookie banner for WordPress

So that here we will show you how to implement cookie consent banner on your WordPress website without using any plugins. We will simply add a piece of code to accomplish that.

Step 1: Visit Osano website and click on “Download Open Source “.

Visit Osano site and click on download open source

Step 2: Click “Start Coding” to customize cookie consent notice.

Click start coding to customize cookie consent notice

Step 3: Select “Position” then click on the desired available options to show cookie banner on your website such as at top or bottom.

Select position then click on the desired available options to show cookie banner on website

Step 4: Select your desired “Layout”, such as block or classic.

Select your desired layout, such as block or classic

Step 5: Under “Palette” choose a color theme or create your own.

Under palette choose a color theme or create your own

Step 6: Provide a link to your cookie policy page.

Provide a link to your page about privacy-cookie policy

Step 7: Under “Compliance type” select “Just tell users that we use cookies”.

Under compliance type select just tell users that we use cookies

Step 8: Optionally, you can customize the text of the cookie banner.

Optionally you can customize the text of the cookie banner

Step 9: Download and install “Insert Headers and Footers” plugin from WordPress repository. After successful installation activate the plugin.

If you need assistance how to download and install WordPress plugin then you can read our step by step guide on the same.

Step 10: Now “Copy HTML” to your clipboard and put this code at header section of “Insert Headers and Footers” plugin.

Add CSS code to your header section
CSS code successfully added to header section

Step 11: Press “Copy Code” and put this code at body section of “Insert Headers and Footers” plugin.

Add JavaScript code to your body section
JavaScript code successfully added to body section

Click “Save” button. Now you have successfully integrate cookie consent notice banner on your WordPress website.

Step 12: Visit your WordPress website and you will see the cookie notice being displayed.

Visit your website and you will see the cookie notice being displayed

Conclusion

You have learned number of options for how and where to display your cookie consent notices on the WordPress website without using plugins.

However, you need to make sure that it is displayed in a prominent way. Your website now complies with the “European Union Cookie Law” and you became more comfortable with editing WordPress.

There is no need to install a plugin if the same functionality can be achieved by adding a piece of code.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Sunil Pradhan

Hi there đź‘‹ I am a front-end developer passionate about cutting-edge, semantic, pixel-perfect design. Writing helps me to understand things better.

1 comment

  • Thanks for sharing this article. It helped me to add cookie banner to my WordPress site. This solution is more quick and I even do not need to install one more plugin for my WordPress site.

Stay Updated

Want to be notified when our article is published? Enter your email address below to be the first to know.

Sunil Pradhan

Hi there đź‘‹ I am a front-end developer passionate about cutting-edge, semantic, pixel-perfect design. Writing helps me to understand things better.