This guide provides step-by-step instructions for installing the LiveChat widget on your WordPress website. Choose the method that works best for your setup.
There are several ways to add the LiveChat widget to your WordPress site. We recommend Method 1 (Theme Footer) for the best performance and site-wide coverage.
YOUR_COMPANY_ID with your actual Account IDhttps://poplivechat.com for production deploymentThis method adds the chat widget to all pages of your WordPress site by editing the theme's footer file.
Log in to your WordPress admin panel (usually at your-site.com/wp-admin).
Go to Appearance → Theme File Editor in your WordPress admin sidebar.
Note: If you don't see "Theme File Editor", you may need to enable file editing in your wp-config.php file by adding:
define('DISALLOW_FILE_EDIT', false);
In the Theme File Editor, select footer.php from the list of theme files on the right side.
Find the closing </body> tag (usually at the very end of the file).
Paste the following code just before the </body> tag:
<!-- LiveChat Chat Widget - WordPress Integration -->
<script>
// Defer loading of LiveChat widget until page is fully loaded
(function() {
function loadLiveChatWidget() {
// Load CSS dynamically
var cssLink = document.createElement('link');
cssLink.rel = 'stylesheet';
cssLink.href = 'https://poplivechat.com/css/chat-widget.css';
cssLink.media = 'all';
document.head.appendChild(cssLink);
// Load JS dynamically
var jsScript = document.createElement('script');
jsScript.src = 'https://poplivechat.com/js/chat-widget.js';
jsScript.async = true;
jsScript.onload = function() {
// Initialize chat widget after script loads
window.LiveChatWidget.init({
companyId: 'YOUR_COMPANY_ID',
buttonText: '💬 Chat Now',
buttonPosition: 'bottom-right',
primaryColor: '#667eea'
});
};
document.body.appendChild(jsScript);
}
// Wait for full page load before loading chat widget
if (window.addEventListener) {
window.addEventListener('load', loadLiveChatWidget, false);
} else if (window.attachEvent) {
window.attachEvent('onload', loadLiveChatWidget);
} else {
window.onload = loadLiveChatWidget;
}
})();
</script>
⚠️ Important: Replace YOUR_COMPANY_ID with your actual Account ID (e.g., XU22). The official domain is poplivechat.com.
Click the Update File button at the bottom of the editor.
Visit your website to verify the chat widget appears in the bottom-right corner.
If you update your WordPress theme, the code you added to footer.php will be lost.
To prevent this, consider using a Child Theme or Method 2 (Plugin) below.
This method uses a WordPress plugin to add the code, which is safer and won't be lost during theme updates.
Go to Plugins → Add New in your WordPress admin.
Search for "Insert Headers and Footers" by WPBeginner and click Install Now, then Activate.
Alternative plugins: "Code Snippets", "WPCode", or any custom code injection plugin.
Go to Settings → Insert Headers and Footers (or your plugin's settings page).
Paste the LiveChat code (from Method 1, Step 4) into the "Scripts in Footer" section.
Click Save.
If you use a page builder, you can add the chat widget using HTML/Custom Code blocks.
Most page builders (Beaver Builder, Divi, etc.) have an HTML/Custom Code widget. Add the LiveChat code there.
For site-wide display, use the builder's Theme Builder or Header/Footer feature.
For developers who want to add the code programmatically via PHP.
Go to Appearance → Theme File Editor and select functions.php.
Add the following code at the end of functions.php:
<?php
// Add LiveChat widget to WordPress footer
function add_livechat_widget() {
?>
<!-- LiveChat Chat Widget -->
<script>
(function() {
function loadLiveChatWidget() {
var cssLink = document.createElement('link');
cssLink.rel = 'stylesheet';
cssLink.href = 'https://poplivechat.com/css/chat-widget.css';
cssLink.media = 'all';
document.head.appendChild(cssLink);
var jsScript = document.createElement('script');
jsScript.src = 'https://poplivechat.com/js/chat-widget.js';
jsScript.async = true;
jsScript.onload = function() {
window.LiveChatWidget.init({
companyId: 'YOUR_COMPANY_ID',
buttonText: '💬 Chat Now',
buttonPosition: 'bottom-right',
primaryColor: '#667eea'
});
};
document.body.appendChild(jsScript);
}
if (window.addEventListener) {
window.addEventListener('load', loadLiveChatWidget, false);
} else if (window.attachEvent) {
window.attachEvent('onload', loadLiveChatWidget);
} else {
window.onload = loadLiveChatWidget;
}
})();
</script>
<?php
}
add_action('wp_footer', 'add_livechat_widget');
?>
⚠️ Replace: YOUR_COMPANY_ID with your actual Account ID. Official domain is poplivechat.com.
Chat widget not appearing?
Widget appears but won't connect?
You can customize the chat widget appearance by modifying the initialization parameters:
window.LiveChatWidget.init({
companyId: 'YOUR_COMPANY_ID', // Required: Your account ID
buttonText: '💬 Chat Now', // Button text
buttonPosition: 'bottom-right', // Position: 'bottom-right' or 'bottom-left'
primaryColor: '#667eea', // Theme color (hex code)
wsHost: '127.0.0.1', // WebSocket host (default: 127.0.0.1)
wsPort: 8282 // WebSocket port (default: 8282)
});
YOUR_COMPANY_ID with your actual Account ID from the dashboardIf you encounter any issues during installation, please contact our support team:
📧 Email: contact@items7.com
📖 View General Installation Guide
🏠 Access Dashboard