← Back to Installation Guides
Installation Guide

Install on WordPress

Paste consent-widget.js in the Head as the first script. Use the header tool you already have. Do not assume Elementor.

Before you start

Copy the Header snippet from Banner Setup → Installation. It already includes your Configuration ID. Use that exact tag. Do not wrap it in PHP unless your snippet plugin only accepts PHP.

<script src="https://www.sitetrust.com/consent-widget.js"
  data-configuration-id="YOUR_CONFIGURATION_ID">
</script>

If the site already loads Google Tag Manager in the head, stop and use the GTM guide instead. Do not install both ways.

Pick the method you already use

Ask how the site adds header scripts today: Elementor Custom Code, Insert Headers and Footers / WPCode, Code Snippets, or something else. Keep that tool. You do not need a new plugin just for SiteTrust.

Option A — Elementor Custom Code

Use this only if the site already runs Elementor Pro Custom Code.

Step 1. Open Custom Code

In WordPress admin go to Elementor → Custom Code and add a new item.

Step 2. Paste the snippet

Paste the SiteTrust script exactly. Do not wrap it in PHP.

Step 3. Set location and conditions

Location: Head. Display Conditions: Entire Site. Priority: first, before GTM, Analytics, pixels, and chat.

Step 4. Publish

Activate the code, then view the public site.

Option B — Insert Headers and Footers / WPCode

Step 1. Open the header field

Open the plugin settings for Header / <head>.

Step 2. Paste at the top

Paste the SiteTrust script as the first code in that field, above every other tag.

Step 3. Save

Save and refresh a public page in Incognito.

Option C — Code Snippets or a similar plugin

Step 1. Create a head snippet

Create a snippet that runs in the site header as HTML/JS, site-wide.

Step 2. Paste the raw script

Paste the same <script src="…consent-widget.js" …> tag. Do not convert it to echo and add_action('wp_head') unless the plugin only accepts PHP.

Step 3. Activate first

Make sure it loads before other tracker snippets.

Option D — Theme File Editor, last resort

Edit a child theme, not the parent. Open header.php (classic themes) or the theme head template and paste the script as the first script inside <head>. Theme updates can overwrite this. Prefer a header plugin.

WooCommerce and page builders

WooCommerce, Gutenberg, Bricks, Oxygen, and other builders do not change the rule. The consent script still belongs in the global head, first. Checkout and product pages must load it too. Do not add a second copy only on the homepage.

After you publish

  1. Open the live URL in an Incognito window, not only the editor preview.
  2. Confirm the banner appears before any click.
  3. Accept once and Decline once in separate clean sessions.
  4. Follow Test default, accept, and decline.
  5. Run Site Audit in the Client Trust Center.

Need help?

Email wecare@sitetrust.com with your site URL and platform. One business day response, Monday through Friday.