How to add a cookie banner on WordPress

WordPress

Step-by-step: paste your privacy policy URL

  1. Generate your hosted cookie banner script URL.
  2. Add it via a header/footer plugin, your child theme’s wp_head hook, or a consent plugin that accepts an external script URL.
  3. Disable duplicate cookie banners so only one UI collects consent.
  4. Clear caches (plugin + CDN) and verify the banner on a private window.
  5. Check GA4/Ads tags fire only after the appropriate consent update.

FAQ

Will caching break the banner?

Full-page caches can serve stale HTML. Exclude the banner script from aggressive defer/combine rules if it stops loading.