Why WordPress is its own playbook
WordPress runs ~43% of the web, but GA4 lives in three different places depending on how it was installed: the official Site Kit plugin, MonsterInsights, or theme-level header injection. Each cleans up differently. Skip the wrong one and you’ll dual-tag forever without realising.
Pre-flight
- Find every GA4 install. Open Chrome DevTools → Sources → search “G-” across all loaded scripts. You should find the Measurement ID once, not three times. If multiple — note where each comes from.
- Identify the install method: Site Kit (Plugins → installed list), MonsterInsights (Plugins), or theme-direct (check `header.php` or theme custom-code field).
- Backup database before plugin changes. WP-CLI:
wp db export pre-migration.sql.
Step-by-step
1. Install Plausible WordPress plugin (Day 1)
Install Plausible Analytics — Privacy Friendly Analytics from the WP plugin directory. Free, official, MIT.
<br />
wp plugin install plausible-analytics –activate<br />
Configure: Settings → Plausible Analytics → enter your domain. Enable “Use a self-hosted version” if you proxy through `/stats/`. Enable “Track 404 pages” and “Outbound links” — these are free goals.
2. Configure custom events (Day 1–2)
The plugin has a “Custom Events” section. Add the goals you want tracked. Common WordPress goals:
- Comment submitted (selector:
#commentform [type=submit]) - Newsletter signup (form selector or class)
- WooCommerce purchase (handled separately — see WooCommerce recipe)
- Contact form 7 / Gravity Forms / Formidable submissions
3. Dual-tag (Days 2–14)
Leave GA4 running in parallel for two weeks. Compare daily with the Parallel-Run Validator.
4. Cleanup phase — the WordPress-specific work (Day 14)
This is where most teams fail. Cleanup must be in this order:
If GA4 was via Site Kit:
<br />
# In wp-admin: Site Kit → Analytics → Disconnect<br />
# Then deactivate Site Kit if no other Google services in use:<br />
wp plugin deactivate google-site-kit<br />
If GA4 was via MonsterInsights:
<br />
wp plugin deactivate google-analytics-for-wordpress<br />
wp plugin uninstall google-analytics-for-wordpress</p>
<p># MonsterInsights leaves orphan options — clean them:<br />
wp option delete monsterinsights_settings<br />
wp option delete monsterinsights_settings_ms<br />
wp option delete monsterinsights_db_version<br />
If GA4 was direct in theme:
<br />
# Find the gtag code in:<br />
# wp-content/themes/<your-theme>/header.php<br />
# OR Customizer → Additional CSS / Header Code<br />
# OR Theme Options → Custom Header Code</p>
<p># Verify removal:<br />
curl -s https://yoursite.com/ | grep -c ‘gtag\|G-XXXXX’<br />
# Should return 0<br />
5. Verify (Day 15)
Open Chrome DevTools → Network → reload. Filter by “google” — should be empty. Filter by “plausible” or “/stats/” — should show pageview pings. If you still see Google requests, MonsterInsights uninstall didn’t clean its custom-code field. Check Settings → MonsterInsights leftover options.
WordPress-specific gotchas
- UTM persistence — UA stored campaign in `_ga` cookie for 2 years. Plausible has no equivalent. Add a custom event
plausible('Visit', {props: {utm_source}})on first visit if you need attribution windows. - Caching plugins — WP Rocket / W3 Total Cache cache the page HTML. After plugin changes, purge cache or you’ll see stale gtag for hours.
- Multisite — Each subsite needs its own Plausible domain configuration. The plugin doesn’t auto-network-activate the site setting.
- WP_HOME mismatch — If
WP_HOMEdiffers from site URL, Plausible may track under the wrong domain. Checkwp option get home.
Frequently asked
Do I need to remove gtag from theme files even if I deactivate Site Kit?
Yes. Deactivating Site Kit removes its loader, but if a previous developer copied gtag directly into header.php, that copy survives plugin removal.
What about WooCommerce events?
Use the dedicated /recipes/woocommerce/ga4-to-plausible/ recipe — WooCommerce purchase events need separate mapping.
Does the Plausible plugin support proxying?
Yes. Settings → Plausible → “Use a self-hosted version” + “Avoid being blocked by adblockers”. The plugin handles the /stats/ proxy automatically via wp-admin endpoint.
Will my caching plugin break Plausible?
The Plausible script is async and small (~1.4 kB). Caching plugins shouldn’t interfere. Object-cache plugins don’t matter for static script delivery.
Can I migrate Yoast / SEOPress goal tracking?
SEO plugins don’t track goals — they manage meta tags. Goals are analytics concern. No migration needed there.