WordPress
Steps to install snippet on a WordPress site
- Copy the JS snippet from Data Collection under settings
Plan Requirements
For WordPress.com sites: Adding custom code to headers requires a Business plan, Commerce plan, or legacy Pro plan. If you have a Free, Personal, or Premium plan, you'll need to upgrade to access this feature.
For self-hosted WordPress sites: All methods below are available regardless of hosting plan.
Method 1: Using Insert Headers and Footers Plugin (Recommended)
This is the safest and most user-friendly method, especially for WordPress.com Business/Commerce plan users:
- Install and activate the free Insert Headers and Footers plugin by WPCode
- Navigate to Code Snippets → Header & Footer in your dashboard
- Paste the JS snippet into the Header box
- Click Save Changes
This method is update-safe and doesn't require editing theme files directly.
Method 2: Using WordPress Theme Editor
Note: This method requires WordPress.com Business/Commerce plan or self-hosted WordPress.
- Log in to your WordPress admin dashboard
- Go to Appearance → Theme Editor (or Appearance → Editor in older versions)
- Select your active theme
- Open the
header.php
file - Paste the JS snippet just before the closing
</head>
tag - Click Update File
Verification
After installation, you can verify the snippet is working by:
- Visiting your WordPress site in a browser
- Checking the browser's developer tools (Network tab) for Syft tracking requests
- Monitoring your Syft dashboard for incoming data
- Using "View Page Source" to confirm the snippet appears in the
<head>
section
Important Notes
- Backup your site before making any changes to theme files
- If using Method 2 (Theme Editor), you'll need to re-add the snippet after theme updates
- Test the installation on a staging site first if possible