# Install on WordPress

> Use a header scripts plugin such as WPCode, or the theme header.php, then purge the page cache.

Section: Installation guides  
Canonical page: https://statsy.co/docs/install/wordpress  
Last updated: 2026-09-15

WordPress has two sensible places for the tag: a header scripts plugin, or the theme itself. The plugin survives theme updates, so prefer it.

## Where it goes

1. With a pluginInstall a header scripts plugin such as WPCode. Add a new snippet, choose the site-wide header location, paste the tag, and activate it.
2. Or in the theme**Appearance › Theme File Editor**, open `header.php`, and paste the tag just before `</head>`. Use a child theme so the next theme update does not wipe it.

```html
<script defer data-website-id="ws_XXXXXXXX" data-domain="yourstartup.com" src="https://statsy.co/js/script.js"></script>
```

## Confirm it works

Open your site in a logged-out browser and check **Live**. Logged-in admin views count like any other visit, so use a private window if you want a clean test.

## Purge the page cache

This is the one that catches everyone. A caching plugin or a CDN in front of WordPress keeps serving the old HTML, without the tag, long after you saved it. Purge the cache after installing, then view source on a page and search for `statsy`. If it is not there, the cache is still stale.

> **Tip.** Your own visits will pile up if you work on the site all day. Add your office IP under **Site settings › Tracking › Excluded IPs**, or exclude `/wp-admin/*` under excluded paths. See [Exclude your own visits and bots](https://statsy.co/docs/tracking-script/exclude-visits).

Previous: [Install on Remix](https://statsy.co/docs/install/remix)  
Next: [Install on Shopify](https://statsy.co/docs/install/shopify)