Contact
Free cookie consent banner · Website Tools

LiteCookie.

Add a GDPR-friendly cookie banner to any website with one line of code: accept, reject or choose categories, with optional scripts blocked until consent.

Free for personal and commercial usev1.0PHP 7.4+ no database
LiteCookie demo page with cookie consent banner at the bottom
Free download

One ZIP file, 159 KB, with the full PHP source code and a README.

No database

Data is stored in protected files. Works on any PHP hosting.

Admin panel included

Modern, responsive admin with light and dark mode.

Combine with other Lite scripts

Same design, same admin and same core in every script.

What is LiteCookie?

Free cookie consent banner with script blocking and Google Consent Mode v2.

LiteCookie is a free cookie consent solution. You add one script line to any website (HTML, WordPress, Shopify or PHP), and visitors see a banner where they can accept all, reject optional cookies or choose categories. Optional scripts such as analytics and advertising stay blocked until the visitor agrees, and Google Consent Mode v2 receives the choice automatically. Equal-weight buttons keep your banner fair, and a dashboard with anonymous counters shows how visitors respond.

LiteCookie features

  • One line of JavaScript works on any website, no matter the platform
  • Accept all, Reject optional and Customize with categories (analytics, marketing, preferences)
  • Blocks scripts and iframes until consent: type="text/plain" data-lite-consent="analytics"
  • Google Consent Mode v2 support (analytics_storage, ad_storage, ad_user_data, ad_personalization)
  • Four positions: bottom bar, left or right box, centered popup; light, dark or automatic theme; your accent color
  • Remembers the choice for N days; a 'Cookie settings' link lets visitors change their mind
  • Anonymous consent statistics (no IP address or identifier is stored) with a 30-day chart
  • All texts editable and translatable; JavaScript API: LiteCookie.consent('analytics'), LiteCookie.open()
  • Flat-file storage: no MySQL, one-click data backup

LiteCookie screenshots

Real screenshots of LiteCookie: the public pages your visitors see and the admin panel you use to manage them.

LiteCookie demo page with cookie consent banner at the bottom
The banner on a page
LiteCookie admin dashboard with consent statistics chart
Consent statistics
LiteCookie install instructions with code snippets
Install code
LiteCookie banner settings
Banner settings

How LiteCookie works

  1. Open Admin > Settings and edit the banner texts, buttons, position, colors and the categories you use.
  2. Open Admin > Install: copy the script line into the <head> of every page of your website.
  3. Block your analytics and marketing scripts by changing them to type="text/plain" and adding data-lite-consent="analytics" (or marketing).
  4. Add a Cookie settings link in your footer: <a href="#" data-lite-cookie-open>Cookie settings</a>.
  5. Check Dashboard for the share of visitors who accept, reject or customize. Mention your cookies in your privacy policy.

Install LiteCookie in 5 minutes

  1. Download LiteCookie.zip and unzip it.
  2. Upload the LiteCookie folder to your web hosting (FTP or file manager).
  3. Make the data and uploads folders writable.
  4. Open /admin/ in your browser and create your admin account.
  5. Click Add sample content in Settings, or start adding your own.

Requirements

  • PHP 7.4 or newer (PHP 8.x recommended)
  • Apache or nginx, any shared hosting
  • No MySQL: files in the data folder
  • README with full instructions is inside the ZIP

LiteCookie questions

Does LiteCookie make my website GDPR compliant?

It gives you a consent mechanism that follows the usual rules: opt-in for optional cookies, equal buttons, a way to withdraw consent. Compliance also depends on your cookies, policies and processes, so this is not legal advice.

Does it work if my website is not PHP?

Yes. Install LiteCookie on any PHP host and add the one-line script to any website, including static HTML, WordPress and Shopify.

Need more than LiteCookie?

A cookie banner works best with analytics that respect privacy. Visit Analytics is a self-hosted visitor statistics script: you own the data and need no third-party cookies:

Explore Visit Analytics →

More free PHP scripts

Website Tools

LiteNotes

A fast sticky-notes board for your own server: quick add, colors, tags, search and pinning. Share selected notes on a public page.

Website Tools

LiteProtect

Create a members area in minutes: protect any PHP page with two lines of code, serve private files to members only, and manage users and groups in an admin panel.

Website Tools

LiteTasks

Organise work on your own server: a kanban board with drag and drop, projects, priorities and due dates, plus an optional public roadmap.

Browse all 20 free PHP scripts or see our professional PHP scripts.