Skip to main content
Adding the Pockla snippet to your WordPress site’s <head> section can be done in several ways. Choose the method that works best for you.

The Snippet

<script>var p=new URLSearchParams(location.search).get('pklid');if(p)document.write('<script src="https://embed.pockla.io/'+p+'.js"><\/script>');</script>
The easiest way is to use a header/footer plugin.
1

Install a Plugin

Install and activate one of these plugins:
  • Insert Headers and Footers (by WPBeginner)
  • WPCode (formerly Insert Headers and Footers)
  • Header Footer Code Manager
2

Add the Snippet

Go to the plugin’s settings (usually under Settings or Tools)Paste the Pockla snippet in the Header section:
<script>var p=new URLSearchParams(location.search).get('pklid');if(p)document.write('<script src="https://embed.pockla.io/'+p+'.js"><\/script>');</script>
3

Save

Click Save to apply changes
Using a plugin ensures the snippet persists through theme updates.

Method 2: Theme Editor

Add the snippet directly to your theme’s header file.
1

Open Theme Editor

Go to AppearanceTheme File Editor(On older WordPress versions: AppearanceEditor)
2

Find header.php

In the right sidebar, click on header.php (or Theme Header)
3

Add the Snippet

Find the <head> tag and paste the Pockla snippet at the very top, right after the opening tag:
<head>
<script>var p=new URLSearchParams(location.search).get('pklid');if(p)document.write('<script src="https://embed.pockla.io/'+p+'.js"><\/script>');</script>

<?php wp_head(); ?>
4

Update File

Click Update File to save
Theme editor changes will be lost if you update your theme. Use a child theme or a plugin for permanent changes.

Method 3: functions.php

Add the snippet programmatically via your theme’s functions file.
1

Open functions.php

Go to AppearanceTheme File Editor and select functions.php
2

Add the Code

Add this code at the end of the file:
function add_pockla_script() {
    echo '<script>var p=new URLSearchParams(location.search).get("pklid");if(p)document.write(\'<script src="https://embed.pockla.io/\'+p+\'.js"><\/script>\');</script>';
}
add_action('wp_head', 'add_pockla_script', 1);
The 1 priority ensures it loads early in the <head>.
3

Update File

Click Update File to save
For permanent changes, add this code to a child theme’s functions.php instead.

Frequently Asked Questions

  • Plugin method – Best for most users. Survives theme updates.
  • Theme editor – Quick but temporary. Lost on theme updates.
  • functions.php – Good for developers. Use a child theme.
No. The snippet is tiny and only loads an external script when a visitor arrives via a Pockla link. Regular visitors see zero additional overhead.
Yes. The Pockla snippet works with all major caching plugins (WP Rocket, W3 Total Cache, etc.). You may need to clear your cache after installation.
We don’t recommend GTM for Pockla. GTM loads scripts with a delay, causing flicker. Install directly in the header for the best experience.
Yes. Remove it from wherever you added it (plugin settings, header.php, or functions.php).

Need Help?

Contact Support

Get help with WordPress installation