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

The Script

<script src="https://cdn.pockla.io/pockla.min.js"></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 Script

Go to the plugin’s settings (usually under Settings or Tools)Paste the Pockla script in the Header section:
<script src="https://cdn.pockla.io/pockla.min.js"></script>
3

Save

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

Method 2: Theme Editor

Add the script 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 Script

Find the <head> tag and paste the Pockla script right after it:
<head>
<script src="https://cdn.pockla.io/pockla.min.js"></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 script 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:
// Add Pockla personalization script
function add_pockla_script() {
    echo '<script src="https://cdn.pockla.io/pockla.min.js"></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.
Less than 4KB when gzipped—extremely lightweight.
No. The script is highly optimized and served from a global CDN.
Yes. The Pockla script 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