WordPress Installation
Install the nuhello chatbot on your WordPress website.
Method 1: Using a Plugin (Recommended)
The easiest way to add the chatbot to WordPress is using the Insert Headers and Footers plugin.
Step 1: Install the Plugin
- Go to Plugins → Add New in your WordPress admin
- Search for "Insert Headers and Footers" by WPCode
- Click Install Now and then Activate
Step 2: Add the Script
- Go to Code Snippets → Header & Footer (or Settings → Insert Headers and Footers)
- Paste your nuhello script in the Header section:
<script>
window.nuhelloSettings = {
key: "YOUR_PIXEL_KEY",
botId: "YOUR_BOT_ID"
};
(function() {
var s = document.createElement('script');
s.src = 'https://cdn.nuhello.com/widget.js';
s.async = true;
document.head.appendChild(s);
})();
</script>- Click Save Changes
Method 2: Theme Editor
If you prefer not to use a plugin, you can add the script directly to your theme.
Step 1: Access Theme Editor
- Go to Appearance → Theme File Editor
- Select your active theme from the dropdown
Step 2: Edit header.php
- Find and click on header.php in the file list
- Locate the
</head>tag - Paste your nuhello script just before
</head>:
<script>
window.nuhelloSettings = {
key: "YOUR_PIXEL_KEY",
botId: "YOUR_BOT_ID"
};
(function() {
var s = document.createElement('script');
s.src = 'https://cdn.nuhello.com/widget.js';
s.async = true;
document.head.appendChild(s);
})();
</script>
</head>- Click Update File
Note: This method may be overwritten when you update your theme. Consider using a child theme or the plugin method.
Method 3: Using functions.php
Add the script via WordPress hooks for a cleaner approach:
- Go to Appearance → Theme File Editor
- Select functions.php
- Add this code at the end:
function add_nuhello_chatbot() {
?>
<script>
window.nuhelloSettings = {
key: "YOUR_PIXEL_KEY",
botId: "YOUR_BOT_ID"
};
(function() {
var s = document.createElement('script');
s.src = 'https://cdn.nuhello.com/widget.js';
s.async = true;
document.head.appendChild(s);
})();
</script>
<?php
}
add_action('wp_head', 'add_nuhello_chatbot');- Click Update File
Clear Your Cache
After installation, clear any caching plugins you may have:
- WP Super Cache: Settings → WP Super Cache → Delete Cache
- W3 Total Cache: Performance → Dashboard → Empty All Caches
- LiteSpeed Cache: LiteSpeed Cache → Toolbox → Purge All
- WP Rocket: Settings → WP Rocket → Clear Cache
Verify Installation
- Visit your website in a new browser tab
- The chat widget should appear in the bottom-right corner
- Click on it to start a conversation
Troubleshooting
Widget not showing?
- Clear your browser cache and WordPress cache
- Check if any security plugins are blocking external scripts
- Ensure the script is placed correctly before
</head> - Check browser console (F12) for errors
Conflicts with other plugins?
Some optimization plugins may interfere with the script. Try:
- Excluding the nuhello script from minification
- Adding
cdn.nuhello.comto your CDN/optimization whitelist