Skip to content
iAgentify

Step by step

Install the chat on WordPress

Paste the chat code into your WordPress site with a header and footer code plugin or from the theme options, and check that it appears on your website.

In the app:
Agents › your agent › Widget › Installation
Open the app
Reviewed on
6 min read
In this article

On WordPress you install the chat by pasting your agent’s line of code into the footer of every page. The most reliable way is a plugin of the kind that adds code to the site’s header and footer: it keeps the code outside the theme, so it is not lost when the theme updates. There is no iAgentify plugin for WordPress, and you do not need one.

Before you start

  • The agent has to be active. An agent that is a Draft or is Paused does not show the chat even when the code is in place. Switch it on with the Activate button (or Resume, if it was paused) on the agent’s page.
  • You need to sign in to WordPress as an administrator. That is the role that can install plugins and change the theme. If you do not have it, pass the code and this article to whoever looks after the website.
  • If your site is on WordPress.com, check your plan. When this article was written (October 2026), WordPress.com only allowed installing plugins and adding your own code on some of its paid plans. Check the WordPress.com help to see what yours includes.

Copy your agent’s code

  1. In iAgentify, go to Agents and open your agent.

  2. Open the Widget tab and, inside it, Installation.

  3. Under Installation code, press Copy. It is a single line, like this one:

    <script src="https://backendiagentify.yarqat.com/widget.js" data-agent="your-agent-key" async></script>

Always copy the one in the app, not the one in this article: yours carries your agent’s public key. There is more detail in install the chat on your website.

  1. In the WordPress admin, go to Plugins and choose the option to add a new one.

  2. Type “header footer code” into the plugin search.

  3. Choose a plugin that lets you add code to the footer of the whole site. WPCode is one of the most widely used; any other with a box for the footer works the same way.

  4. Press Install Now and, when it finishes, Activate.

  5. Open the plugin’s screen for header and footer code. In WPCode it is in the plugin’s menu and is called Header & Footer; depending on the language of your WordPress it may appear translated.

  6. Paste the chat line into the footer box (Footer). It is the one that adds the code before </body> on every page.

    If the plugin only has a box for the header (<head>), paste it there: the chat waits for the page to finish loading and works the same.

  7. Save the plugin’s changes.

  8. If your WordPress uses a caching plugin, clear the cache. Without this step your visitors may keep receiving the old copy of the pages, without the chat.

Other ways to paste it

From the theme or page builder options

Some themes and page builders have their own box for this. Look for it in the theme options under a name such as “custom code”, “scripts”, “integrations” or “footer code”: what you need is the place where the theme lets you add code before </body> on the whole site. Paste the line, save and clear the cache.

That setting belongs to the theme. It is normally kept when the theme updates, but if you switch theme you will have to paste the line into the new one.

Editing the theme file, as a last resort

Do this only if you cannot use either of the two ways above, and preferably with whoever built the site. The line goes in the theme’s footer.php file, on the line above </body>, from the theme file editor (usually under Appearance or Tools) or by FTP. Many recent themes, known as block themes, do not have that file: on those, use the plugin.

Check that it works

  1. Open your website in a private browser window. While you are signed in to WordPress, many caching plugins show you the freshly built page and not the copy your visitors receive.

  2. The chat button appears in a bottom corner of the page. Press it.

  3. Type a question. The reply arrives within seconds and the conversation shows up under Conversations, inside the app.

That test is a real conversation: it uses credits and counts in your analytics.

Common problems on WordPress

  • The cache keeps serving the old page. Clear the caching plugin’s cache and, if your hosting or a content delivery network (CDN) keeps copies of the pages, theirs too.
  • An optimisation plugin delays or combines JavaScript. With options such as “delay JavaScript” or “combine JavaScript”, the chat may not appear until the visitor moves the mouse or touches the screen, or may not appear at all. Those plugins have an exclusion list: add the address of the chat script to it, the one in src inside your line of code.
  • The code is pasted inside a page or a post. There it would only show on that page, and WordPress may remove the code when you save, depending on your user’s role. Paste it with the plugin, which puts it on the whole site.
  • The code is pasted twice. If it is in the plugin and also in the theme, nothing breaks: the second copy does nothing. If the two lines belong to different agents, only one is loaded, so keep only the line of the agent you want.

Add your domain to the allowed domains

While the Allowed domains list is empty, any website that copies your line of code can load your chat and use up your credits. Under Agents › your agent › Widget › Installation › Allowed domains, type your WordPress site’s domain, press Add and then Save changes. A domain such as yourcompany.com also includes www.yourcompany.com.

If your site can be seen at more than one address (a test subdomain, the temporary address your hosting gives you, or a WordPress.com address such as yourbusiness.wordpress.com), add them all, each one in full: at an address that is not on the list the chat does not appear. The details are in limit the chat to your domains.

If the chat does not appear

On WordPress the most common cause is the cache: clear it and look again in a private window. Then check that the agent is active and that your domain is under Allowed domains. The full list, with how to check each cause, is in the chat does not appear on your website.