How to add Amabrik to WordPress
Add the Amabrik snippet to WordPress with a free header-scripts plugin or your theme header. Step-by-step guide, works with any theme, no Amabrik plugin needed.
Amabrik runs on your WordPress site from a single line of code. There’s no Amabrik plugin to install and nothing to maintain. You paste one <script> tag into your site’s <head>, and every widget you turn on in your dashboard shows up on your live site automatically.
This guide covers two ways to add that snippet: a free header-scripts plugin (the easiest path, and the one we recommend) and editing your theme header directly. Pick one. You don’t need both.
1. Get your snippet
-
Sign in to your Amabrik dashboard at app.amabrik.com.
-
Open the Install page from the left menu.
-
Copy the snippet shown there. It looks like this, with your own site ID in place of
YOUR_SITE_ID:<script async src="https://cdn.amabrik.com/v1/loader.js" data-site="YOUR_SITE_ID"></script>
Always copy the snippet from your own dashboard so the data-site value is correct. The wrong ID means your widgets won’t load.
Method A: a header-scripts plugin (recommended)
This is the easiest method, it works on any theme, and your snippet survives theme updates. We recommend the free WPCode plugin (listed in the directory as “Insert Headers and Footers + Custom Code Snippets”). It’s used on millions of sites and is built for exactly this.
- In your WordPress admin, go to Plugins > Add New Plugin.
- Search for WPCode. Look for Insert Headers and Footers + Custom Code Snippets by WPCode.
- Click Install Now, then Activate.
- In the left menu, go to Code Snippets > Header & Footer.
- Paste your Amabrik snippet into the Header box (not Body or Footer).
- Click Save Changes.
That’s it. The plugin injects the snippet into the <head> of every page for you. Because the code lives in the plugin and not in your theme files, switching or updating your theme won’t remove it.
If you prefer a different header-scripts plugin (for example “Header and Footer Scripts” or “Insert Headers and Footers Code”), the idea is the same: find its header field, paste the snippet, save.
Method B: your theme header (header.php)
Use this only if you’d rather not add a plugin. It’s more fragile, so read the caution below first.
Caution before you start
A theme update can overwrite header.php and wipe your snippet. To avoid that, make the change in a child theme instead of the parent theme. A child theme keeps your edits separate, so updating the main theme leaves your code untouched. If you don’t have a child theme set up, Method A is the safer choice.
Classic themes
- In your WordPress admin, go to Appearance > Theme File Editor.
- If a warning appears about editing files directly, read it, then continue.
- On the right, under Theme Files, click header.php (often labeled “Theme Header”).
- Find the closing
</head>tag in the code. - Paste your Amabrik snippet on the line directly before
</head>. - Click Update File.
Block themes
Many newer WordPress themes are block themes, which use HTML templates instead of a header.php file, so Appearance > Theme File Editor may not appear. In that case, look under Tools > Theme File Editor. If your block theme has no header.php to edit, use Method A instead, which works on every theme.
A note for WordPress.com sites
If your site is hosted on WordPress.com (not a self-hosted WordPress install), adding custom code or installing plugins requires a paid plan that allows it (such as the Personal plan or higher). On a free WordPress.com site, you’ll need to upgrade first. Self-hosted WordPress sites have no such limit.
2. Save and check it’s live
After saving with either method, confirm the snippet is actually on your site:
- Open your site’s home page in a normal browser tab.
- Right-click anywhere and choose View Page Source (or press Ctrl+U on Windows, Cmd+Option+U on a Mac).
- Use Find (Ctrl+F or Cmd+F) and search for
amabrik. - You should see your snippet with
cdn.amabrik.com/v1/loader.jsand your site ID.
If you find it, the install worked.
3. Turn on widgets in the dashboard
The snippet is the connection. Your widgets are controlled entirely from Amabrik, so you never touch your WordPress site again.
- Back in your Amabrik dashboard, open Widgets.
- Create or enable the widgets you want (banner, cookie consent, popup, forms, and so on).
- Publish. Changes go live on your site within seconds, with no WordPress edit needed.
From here, every future change happens in Amabrik. Your WordPress site already has everything it needs.
Troubleshooting
I added the snippet but nothing shows on my site. First, check the snippet is in the page source (see step 2 above). If it’s there, make sure the widget is published in your Amabrik dashboard and that your site’s domain matches the domain set in Amabrik. Amabrik only serves your config to your own domain, so a mismatch blocks it.
A caching plugin is hiding my change. Caching plugins (WP Rocket, W3 Total Cache, LiteSpeed Cache, WP Super Cache) and host or CDN caches can serve an old version of your page. Clear every cache after you save, then reload your site in a private or incognito window.
A theme update removed my snippet. This happens when you edited the parent theme’s header.php directly. Re-add the snippet, and this time use Method A or a child theme so the next update can’t wipe it.
Where exactly do I paste it? Always in the <head>, before the closing </head> tag. With a header-scripts plugin, use the field labeled Header, not Body or Footer.
I can’t find Theme File Editor. On block themes it can live under Tools > Theme File Editor instead of Appearance, and some hosts disable file editing entirely for security. If you can’t reach it, use Method A.
FAQ
Is there an Amabrik plugin for WordPress?
No. Amabrik is one script tag, so there’s nothing to install or update on WordPress. That keeps your site lighter and means no plugin to break after a WordPress core update.
Will this slow down my site?
The snippet uses the async attribute, so it loads without blocking your page. The browser keeps rendering while the script downloads in the background.
Do I need to add the snippet to every page?
No. Both methods put it in the <head> of every page at once, so it’s site-wide from a single paste.
Can I remove Amabrik later?
Yes. Delete the snippet from your header-scripts plugin or theme header, save, clear your cache, and Amabrik is gone. No leftovers.
Does this work on WordPress.com and self-hosted WordPress?
Both. Self-hosted WordPress has no restrictions. On WordPress.com you need a paid plan that allows plugins or custom code.
Last updated June 22, 2026
Want us to install it for you?
Open the Install page in your dashboard and use the Request Installation tab. Our team sets it up for you.