Halloween Sale 15% off Ends in See the plans

Snippet Library

WordPress code snippets, ready to use

3,040 free snippets from the WPIDE team and the community. Copy the code, or add any snippet to your site in one click with WPIDE.

25–36 of 36 snippets “cookie”

  • PHP Analytics & Tracking

    Simple Analytics

    Adds the cookie-free Simple Analytics script to your public pages. No tracking ID is needed: data is matched to the domain you added in Simple Analytics.

  • PHP Privacy & Cookies

    Site Health Checks for Privacy Settings

    Adds Site Health tests that check whether a privacy policy page is published, whether full commenter IP addresses are being stored, and whether the comment cookie consent checkbox is turned on.

  • PHP Plugin Integrations

    Makes page-cache plugins (WP Rocket, W3 Total Cache, WP Super Cache, LiteSpeed Cache and others that respect DONOTCACHEPAGE) skip caching for visitors who carry a cookie you choose, such as a personalisation, A/B test or affiliate cookie.

  • PHP Privacy & Cookies

    Third-Party Requests Inspector in the Admin Bar

    Adds an admin bar item on the front of the site that counts the external domains the current page loads files from, and lists them on click, to help you keep your cookie notice and privacy policy accurate.

  • PHP Analytics & Tracking

    TikTok Pixel

    Adds the TikTok pixel to every public page and records page views, with an option to wait for cookie consent.

  • PHP Analytics & Tracking

    Umami Analytics

    Adds the privacy-friendly Umami analytics script (cloud or self-hosted) to every public page, skipping logged-in staff.

  • PHP Privacy & Cookies

    Vimeo Embeds With "Do Not Track"

    Adds Vimeo's dnt=1 setting to every embedded Vimeo video, which stops Vimeo from setting tracking cookies or collecting session data for your visitors.

  • PHP Analytics & Tracking

    X (Twitter) Pixel

    Adds the X (formerly Twitter) website tag to every public page for conversion tracking and audiences, with an option to wait for cookie consent.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.