
Silvertrail Cookie Banner
v1.4.1Marc Wieland · 2026年11月16日 上架
A consent and cookie banner for WordPress, built for developers and AI agents. Lightweight, and nothing loads before the visitor agrees.
- 正在使用
- 10 以下
- 评分
- 暂无
- 累计下载
- 341
- 最近更新
- 2026年11月23日
贡献者
截图








Silvertrail is a consent and cookie banner for WordPress, built for developers and AI agents. Behind the banner, it holds back each tracker, script and embed that a preset or the site’s code names until the visitor agrees, and passes the choice on to Google, to other plugins and to the site’s own code.
Saying no is as easy as saying yes. “Accept all” and “Only essential” sit side by side at the same size, and a third button opens the choice per group and per service, with the provider, the purpose and a link to its privacy policy.
Why Silvertrail
- Developers and AI first. The setup lives in code, and code wins over the admin. The shell and MCP read it and check it, and over MCP an agent turns presets on too. The complete documentation ships in the plugin, so an agent reads the version the site runs.
- Lightweight. The front end adds one small script and one stylesheet, and the plugin has no external dependencies. It contacts no outside service on its own.
- Fewer cookie banners. A browser that sends Global Privacy Control gets “only essential” without a banner, and a site that only embeds videos and maps shows none, because each embed asks on its own placeholder. As browsers answer more of these questions, the banner can go, and everything behind it keeps working.
- A solid base for consent. One place in WordPress knows each service, holds it back and hands the choice to Google, to other plugins and to the site’s own code.
One choice, passed on
The visitor decides once, and Silvertrail hands the same choice to each of these.
- It sets the Google Consent Mode v2 default before any Google tag, and every choice updates it. Google tags stay blocked until consent, and developers can switch to Advanced mode in code.
- It supports the WP Consent API, so plugins that read the API follow the visitor’s choice.
- Other plugins and the site’s own code read the same choice through
window.silvertrail, thesilvertrail:changeevent andsilvertrail_has(), and base their own decisions on it. - It keeps optional records of each decision: a random consent ID, the choices and the time, with no IP address. The
silvertrail_recordedaction hands each decision to records of your own.
Built for agents and developers
Agents set Silvertrail up as often as people do. The setup lives in code. The shell and MCP read it and check it, and over MCP an agent turns presets on too. The admin keeps only the decisions a site owner makes.
- The complete documentation ships in the plugin folder under
docs/and as llms.txt, so an agent reads the version the site runs. - Code wins over the admin. One filter sets any setting, and the settings page marks each field that code sets.
- Agents work on the shell.
wp silvertrail servicesandwp silvertrail settingsshow every service and each setting with its source, andwp silvertrail validatereports what is wrong, so an agent can check its own work. From WordPress 6.9, the same reads, the presets and the check are abilities, which an MCP client reaches through the MCP Adapter plugin. - Agents check the site in the browser. In a browser with WebMCP, an experiment in Chrome, Silvertrail offers them tools to read and set the choice and to list what the page loaded. On a site with a WebMCP trial token, an agent that browses for a person answers through the same tools. It may allow only essential on its own, and more only with its person’s answer.
- Prompts are built in. The Agents tab copies prompts to check and to set up the site with an agent, the Design tab one to style the banner, and the Leak check writes one for the services it finds. From WordPress 7.0, the Design tab can also send its prompt to the site’s own AI provider.
One call turns on a preset, and the official tag waits for consent:
add_action( 'silvertrail_register', function () {
silvertrail_register_service( 'google-tag-manager', array( 'tag_id' => 'GTM-XXXXXXX' ) );
} );
Any script you mark with type="text/plain" data-silvertrail="service" waits as well. Silvertrail runs it after consent and keeps the order of inline and external scripts. A script that a theme or plugin enqueues waits once you list its handle under a service.
The documentation, also in the plugin folder under docs/, is the complete reference.
Styled by your theme, or by you
Out of the box, the banner looks like part of the site. Change a few values or replace the whole design, as far as the project needs.
- With no setup, the banner reads its colours, corners and buttons from the theme’s
theme.json. - The
silvertrail_designfilter changes single values, such as a colour, the corners or the buttons. - A
silvertrail/silvertrail.cssor your own templates in the theme replace the defaults. Settings › Silvertrail › Design copies a prompt that has an AI assistant write that stylesheet.
Batteries included
The integrations most sites need are built in, so setting it up mostly means ticking boxes.
- YouTube, Vimeo and Google Maps embeds wait behind a placeholder from the moment the plugin is active, and so do embeds from every host you register. The placeholder asks in place, loads the embed once or remembers the service, and opens no banner.
- The Leak check, under Settings › Silvertrail › Tools, opens pages as a first-time visitor, declines, agrees to each service on its own and loads them again. It lists what runs without consent and what starts only after a reload, with what to do about each. It writes a prompt to paste into an AI assistant, which asks for the provider, purpose and privacy policy of each service. A Playwright helper in the plugin’s
testingfolder runs the same check in CI.
Also in the box
- Presets print the official tags of Google Tag Manager, Google Analytics, Google Ads, the LinkedIn Insight Tag and the Meta Pixel once you turn one on and enter its ID.
- It works behind any page cache, as the next section explains.
- Global Privacy Control wins even over an earlier choice. The visitor can still allow more, and the site answers
/.well-known/gpc.json. - It asks every visitor again when the set of services changes.
- A link, block, shortcode or menu item reopens the preferences, and an optional floating button does the same in a corner of the page.
- The preferences show the visitor what the current page held back and which other hosts it loaded from.
- Each site of a multisite network keeps its own cookie.
- Only a browser with WebMCP fetches a second small script for the agent tools.
Page caching
The server renders every gated script and embed blocked, whatever the visitor chose, and the browser activates them on each page view. So a cached page never hands one visitor’s consent to the next, and page caches need no extra configuration.
What it does not do
Silvertrail does not implement the IAB Transparency and Consent Framework, so an ad network that requires a TCF consent string needs a different banner. It does not detect countries either. A site that treats regions differently decides in the silvertrail:before-prompt hook, as the FAQ shows. It does not crawl the site for cookies. The Leak check looks at the pages you list and shows what they actually load.
Free, with an honour licence
Silvertrail is free. When you are paid to put it on a client’s site, consider supporting its development with a site licence at https://marcwieland.name/support/: 29 a year per site, or 199 a year for an agency with any number of sites, in dollars or euros. The licence works on your honour. It adds nothing and withholds nothing, and nothing checks whether you bought one. There is no pro version and no hosted service, and there will be none. The money pays for the upkeep.
Need something it does not do?
Marc Wieland, the developer of Silvertrail, builds new functionality for it as paid work on request. This is feature development, not technical support. Write to silvertrail@marcwieland.name with the site and what it should do. The code is not proprietary, and when most users would benefit from a feature, it goes into the free plugin. That way, the feature one site needs and can fund also helps every other site that runs Silvertrail and gives something back to the WordPress ecosystem.
Privacy
Silvertrail sets one first-party cookie, silvertrail (on the other sites of a multisite network silvertrail_ and the site ID), which holds the chosen services, the version of the settings and the time of the decision. It lasts six months by default, and a developer changes the lifetime with the silvertrail_settings filter. With records turned on, the cookie also holds a random consent ID, and each decision is stored in a database table with that ID, the choices and the time. Silvertrail never stores an IP address or browser details. The plugin contacts no outside service on its own. Write with AI, which only an admin starts, sends the styling prompt to the AI provider the site set up. The services a site turns on load from their providers only after the visitor agrees, as the next section lists.
External services
Each tracker preset below connects to its provider only when an admin turns it on, and only after the visitor agrees to that service. The provider then receives what a browser sends with every request, such as the IP address, the browser details and the address of the page, plus whatever its own code collects. In Consent Mode Advanced, which a developer turns on in code, the Google tags load before consent and send cookieless pings.
- Google Tag Manager, Google Analytics and Google Ads load the Google tag from googletagmanager.com with the ID entered in the settings. Provided by Google: terms, privacy policy.
- The LinkedIn Insight Tag loads from snap.licdn.com with the partner ID. Provided by LinkedIn: terms, privacy policy.
- The Meta Pixel loads from connect.facebook.net with the pixel ID. Provided by Meta: terms, privacy policy.
- The YouTube, Vimeo and Google Maps presets start switched on, but they load nothing themselves. They hold back embeds the site already contains and let the browser load them from youtube.com, vimeo.com or google.com once the visitor agrees. Provided by Google for YouTube (terms, privacy policy) and Google Maps (terms, privacy policy), and by Vimeo (terms, privacy policy).
Write with AI, on WordPress 7.0 and later, sends the styling prompt and the admin’s description of the look to the AI provider set up under Settings › Connectors, through WordPress’s AI Client, and only when an admin clicks it. The prompt holds the styling brief, the theme’s colour and font presets and its current silvertrail/silvertrail.css, and nothing about visitors. The terms and privacy policy of the provider the site chose apply.