Overview
This guide covers three methods for adding the IllumiChat widget to a WordPress website. Choose the method that best fits your comfort level and site setup.| Method | Difficulty | Survives Theme Updates | Best For |
|---|---|---|---|
| WPCode Plugin | Easy | Yes | Most users |
| WordPress Customizer | Easy | Depends on theme | Quick setup |
| Theme Editor | Medium | No | Developers |
Method 1: WPCode Plugin (Recommended)
WPCode (formerly Insert Headers and Footers) is a free plugin that lets you add code snippets without editing theme files.Install WPCode
In your WordPress dashboard, go to Plugins > Add New. Search for “WPCode” and install the free version. Activate the plugin.
Create a New Snippet
Go to Code Snippets > + Add Snippet. Click Add Your Custom Code (New Snippet) and select HTML Snippet.
Add the Widget Code
Paste the following code into the snippet editor:Replace
your-assistant-id with your actual assistant ID from the IllumiChat dashboard.Method 2: WordPress Customizer
If your theme supports the Customizer, you can add the widget code there.Find Additional CSS/JS Section
Look for a section called Additional JavaScript, Custom Code, or Footer Scripts. The exact name depends on your theme.
Not all themes offer this option. If you don’t see a JavaScript or footer scripts section, use the WPCode plugin method instead.
Method 3: Theme Editor
You can add the widget code directly to your theme’sfooter.php file. This method requires familiarity with WordPress theme files.
Add the Widget Code
Add the script tag just before the closing Make sure the script tag appears before
</body> tag:<?php wp_footer(); ?>.Conditional Loading
You may want the widget to appear only on certain pages. Use WordPress template conditionals to control where the widget loads.Using WPCode Conditional Logic
WPCode Pro supports conditional logic natively. In the snippet settings, use the Smart Conditional Logic section to restrict the snippet to specific pages, post types, or URLs.Using PHP Conditionals
If editing your theme or using a PHP-capable snippet plugin:| Conditional | Description |
|---|---|
is_page('pricing') | Only on a page with slug “pricing” |
is_front_page() | Only on the homepage |
is_singular('product') | Only on WooCommerce product pages |
is_category() | Only on category archive pages |
!is_admin() | Everywhere except the admin dashboard |
WooCommerce Integration
If you run a WooCommerce store, you can configure the widget to show product-specific context on product pages.Troubleshooting
Widget does not appear after adding the code
Widget does not appear after adding the code
- Clear your browser cache and any WordPress caching plugin (WP Rocket, W3 Total Cache, etc.)
- Verify the assistant ID is correct
- Check the browser console for JavaScript errors
- Ensure the widget is enabled in the assistant’s settings
- Confirm your domain is in the assistant’s allowed domains list
Widget appears briefly then disappears
Widget appears briefly then disappears
- Check if a Content Security Policy (CSP) header is blocking the widget script
- Add
widget.illumichat.comandbeta.illumichat.comto your CSPscript-srcandconnect-srcdirectives - Some security plugins (Wordfence, Sucuri) may block external scripts — add the widget domain to the allowlist
Widget conflicts with other chat plugins
Widget conflicts with other chat plugins
- If you have another chat widget installed (Intercom, Drift, Tidio), it may conflict with the IllumiChat widget
- Disable other chat plugins or use conditional loading to show only one widget per page
- Check for CSS z-index conflicts — the IllumiChat widget uses
z-index: 2147483647
Caching plugins prevent widget updates
Caching plugins prevent widget updates
- Most caching plugins serve static HTML, which includes the widget script tag
- If you change the assistant ID or widget configuration, clear the cache after making changes
- The widget itself loads dynamically and is not cached, only the script tag inclusion is affected