WP Manifestindependent plugin directory
manifest / privacy / drift-cookie-consent

Drift: Cookie Consent

Drift: Cookie Consent — free WordPress plugin that blocks YouTube and Vimeo embeds until consent via CookieScript or Cookiebot, with a thumbnail and consent message in their place. GPLv2 or later.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/drift-creative-systems/drift-cookie-consent/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Drift Creative Systems

Drift: Cookie Consent

Free WordPress plugin by Drift Creative Systems. Blocks YouTube and Vimeo embeds until marketing consent is given through CookieScript or Cookiebot, and shows the video's thumbnail with a consent message in their place. Settings are under Settings → Drift: Cookie Consent.

  • WordPress.org slug: drift-cookie-consent (submission pending)
  • Licence: GPL-2.0-or-later
  • Requires WordPress 6.4+, PHP 7.4+, and CookieScript or Cookiebot on the site

The user-facing documentation is readme.txt, which WordPress.org displays. This file is for developers.

Structure

drift-cookie-consent.php     Bootstrap: duplicate-install guard, constants, requires
includes/
  settings.php               Defaults, option read + sanitise, Settings API fields
  admin.php                  Settings → Drift: Cookie Consent screen, admin CSS, footer, Plugins-row link
  iframe-blocker.php         Full-page output buffer that rewrites YouTube/Vimeo iframes before the page is sent
  frontend.php               Enqueues front.css / front.js, passes settings as DRIFT_COOKIE_CONSENT
assets/
  front.js                   Builds the placeholder; blocks iframes added after page load; reopens the consent popup
  front.css                  Placeholder, overlay and ratio-container styles
  admin.css                  Settings screen
uninstall.php                Removes the option, on every site in a network

How blocking works

  1. drift_cookie_consent_start_output_buffer() starts a buffer on template_redirect (priority 0). It's skipped in wp-admin, AJAX, REST, cron, feeds, robots, trackbacks and page builder previews (elementor-preview, et_fb, fl_builder, bricks, ct_builder, vc_editable).
  2. On output, WP_HTML_Tag_Processor walks every `