Sift Docs
Frameworks

WordPress

Add Sift to a WordPress site through the theme, a plugin, or a code snippet.

WordPress gives you three ways in. Pick the one that matches how you already manage the site.

Option 1: a code snippets plugin

Install a snippets plugin that can run PHP, then add:

functions.php
add_action( 'wp_head', function () {
	echo '<script defer data-domain="example.com" src="https://sift.agentonboard.xyz/js/sift.js"></script>';
}, 1 );

This survives theme updates, which the next option does not.

Option 2: your child theme

Add the same hook to functions.php in a child theme. Never edit a parent theme directly — the next update removes your change.

Option 3: header plugin

Some SEO and header plugins accept raw <head> code. Paste the plain HTML snippet:

<script
  defer
  data-domain="example.com"
  src="https://sift.agentonboard.xyz/js/sift.js"
></script>

Things that go wrong on WordPress

A caching plugin serves an old page

Purge the cache after adding the snippet. Most caching plugins also have a "combine and minify JavaScript" option that can move or inline scripts. If the snippet disappears from the rendered HTML, exclude it from minification.

The snippet is added twice

A plugin plus a theme hook both firing sends two pageviews per load. Check the rendered source for duplicate sift.js tags.

The domain does not match

If WordPress is installed on blog.example.com and you registered example.com, the pageview is accepted — subdomains roll up to the root. The reverse is not true: a snippet on example.com cannot report to a site registered as blog.example.com.

Logged-in editors inflate the numbers

You can exclude your own visits without touching code. See Ignore yourself.

On this page