Skip to content
Pengo Help Center
Browse all guides

Install Pengo on WordPress

Add the Pengo chat widget to any WordPress site in about five minutes, with a free header-and-footer plugin or a few lines in your theme.

Install the widget 2 min read Updated
On this page

Pengo works on any self-hosted WordPress site. You paste one snippet into your site’s footer, and the chat bubble shows up on every page. Most people use a free plugin, which takes about five minutes and survives theme updates. If you’d rather not add a plugin, you can add the snippet to your theme instead.

On WordPress.com, adding plugins or custom theme code needs a plan that allows them.

#Option 1: Add the snippet with a plugin

This is the easiest route, and the snippet stays in place when you change or update your theme.

  1. In your WordPress admin, go to Plugins › Add New Plugin and search for Insert Headers and Footers.

    The plugin by WPCode is now listed as WPCode – Insert Headers and Footers. Click Install Now, then Activate. Any similar plugin with a footer box works the same way.

  2. Open the plugin’s header and footer settings.

    In WPCode, that’s Code Snippets › Header & Footer. Older versions show it under Settings › Insert Headers and Footers.

  3. Paste the snippet into the Footer box (called Scripts in Footer or Footer Scripts in some versions).

    Pengo snippet
    <!-- Pengo Widget -->
    <script>
      (function() {
        // A stub, so pengo('identify', …) and other calls work before the widget has loaded.
        window.pengo = window.pengo || function() { (window.pengo.q = window.pengo.q || []).push(arguments); };
        window.pengo.propertyId = 'YOUR_PROPERTY_ID';
        window.pengo.q = window.pengo.q || [];
        var script = document.createElement('script');
        script.async = true;
        script.src = 'https://app.pengo.chat/embed.js?v=2';
        var firstScript = document.getElementsByTagName('script')[0];
        firstScript.parentNode.insertBefore(script, firstScript);
      })();
    </script>
  4. Click Save Changes.

  5. Clear your site’s cache if you use a caching plugin, then open your site in a new tab. The chat bubble appears in the corner.

#Option 2: Add the snippet to your theme

Use this if you’re comfortable editing theme files. Make the change in a child theme, otherwise the next theme update overwrites it.

#In functions.php

Add this to your child theme’s functions.php, and paste the snippet you copied from Pengo where the comment is. WordPress prints it at the end of every page through the wp_footer hook.

PHP
add_action( 'wp_footer', function () {
	?>
	<!-- Paste the Pengo snippet here -->
	<?php
} );

This works with classic and block themes.

#In footer.php

Classic themes have a footer.php file. Open it in Appearance › Theme File Editor (or your code editor), find the closing </body> tag near the end and paste the snippet just above it. Block themes don’t have a footer.php, so use the plugin or functions.php instead.

#Caching and optimization plugins

Plugins such as WP Rocket, W3 Total Cache, LiteSpeed Cache, Autoptimize and your host’s own cache can keep serving old pages after you add the snippet. After installing:

  • Clear or purge the cache in each caching plugin and in your hosting dashboard.
  • If the bubble still doesn’t appear, check whether a setting that combines, delays or defers JavaScript is changing the snippet. Exclude the Pengo snippet (or app.pengo.chat) from those optimizations.

#Check that it works

Open your site in a private window and look for the bubble, then confirm that Pengo has detected the install. Verify your installation walks through it, with a troubleshooting checklist if the bubble doesn’t show.

#Other platforms

Common questions

Do I need a Pengo plugin for WordPress?

No. Pengo is one snippet. Any plugin that adds code to your site's footer works, or you can add it to your theme yourself.

The bubble doesn't show after I saved. What now?

Clear the cache in your caching or optimization plugin and your host, then reload the page in a private window.

Was this guide helpful?

Your answer helps us improve it.