Home / Docs / WordPress Plugin
Setup Guide · WordPress

MsgHub WordPress plugin install

The MsgHub WordPress plugin drops the AI chat widget on any WordPress site in under 5 minutes — no theme edits, no FTP, no developer needed. Auto-detects logged-in users, plays nicely with WooCommerce, survives caching plugins. This guide covers install, configuration, and the most common gotchas.

~5 min Beginner-friendly No code required Last updated: 2026-05-14

Overview

The plugin is a thin wrapper around the MsgHub chat widget snippet — but with WordPress-native conveniences:

5-minute install
Search directory or upload ZIP — paste API key — done.
Auto-identify logged-in users
WordPress user → MsgHub Contact. No pre-chat form.
WooCommerce-aware
Past orders, cart, customer tier visible to the AI.
Per-page display rules
Show / hide on specific pages, post types or URL patterns.
Cache-plugin compatible
Works with WP Rocket, W3 Total Cache, LiteSpeed, Cloudflare APO.
Shortcodes & hooks
Open the chat from a button, pre-fill a message, attach metadata.

What the plugin actually does

It loads the MsgHub widget script (https://app.msghub.info/api/v1/widget.js) with your tenant's API key, applying display rules and identification data you've configured. That's it — small footprint, no shadow database, no PHP-side message processing.

Prerequisites

Install

1B

Option B · Upload ZIP manually

Use this method if the directory listing is unavailable in your region or you want a specific version.

  1. Download the latest plugin ZIP from plugin.msghub.info.
  2. WordPress admin → PluginsAdd NewUpload Plugin.
  3. Choose the ZIP file → Install Now.

Activate

2

Click Activate

After install completes, click Activate. A new MsgHub menu item appears in your WordPress sidebar.

If you don't see the menu item, refresh the admin page once.

Configure the plugin

3

Paste your tenant API key

  1. WordPress admin → MsgHubSettings.
  2. In MsgHub (separate tab): sidebar → API Keys+ New API Key. Name it e.g. "WordPress widget", tick scopes contacts:write and messages:send. Copy the key (format mh_live_…) — shown only once.
  3. Also confirm the Chat Widget is enabled: Settings → Chat Widget section → Enabled checkbox is ticked.
  4. Back in WordPress, paste the API key into the plugin Settings page.
  5. Click Save Changes.

Haven't configured the Chat Widget yet? Follow the Web Chat Widget setup first — it's just a Settings page section to enable + customise.

4

Set display rules

By default the widget appears on every page. To control where:

  • Show on: All pages / Specific post types / Specific pages / URL patterns.
  • Hide on: Checkout page, thank-you page, admin pages. Recommended hides: checkout, order-received, my-account/orders.
  • Roles: show only to specific WordPress roles, or hide from logged-in admins (often useful so admins aren't bothered by their own widget).
Common ruleSetting
Hide on checkoutHide on: pages containing "checkout" or "order"
Show only on product pagesShow on: post type product
Hide from adminsHide for roles: administrator, editor
Show on landing pages onlyShow on URLs matching /landing/*
5

Appearance overrides

Most appearance settings live in MsgHub (colour, position, welcome message). The plugin lets you override per-site:

  • z-index — bump above stubborn theme elements (default 999999).
  • Bottom offset — push above floating WhatsApp buttons or cookie banners.
  • Auto-open on first visit — appears 3 seconds after page load. Use sparingly; can annoy.
  • Show on mobile — disable widget below a breakpoint if your mobile design is tight.
6

Logged-in user identification

One of the most valuable features. When a WordPress user is logged in, the plugin passes their name and email to MsgHub automatically — no pre-chat form needed.

  1. Toggle Identify logged-in WordPress users ON.
  2. Pick which user meta fields to send:
display_name→ Contact name in MsgHub
user_email→ Contact email
billing_phone (WooCommerce)→ Contact phone
ID→ Stored as custom attribute wp_user_id
Custom user metaAny user meta key you specify

If the user has previously chatted as a guest, MsgHub merges the guest history into the identified contact record — no lost history.

WooCommerce integration

If WooCommerce is installed and active, the plugin auto-detects it and surfaces commerce context to the AI:

Enable from MsgHubSettingsWooCommerce tab. Granular toggles for each data type.

WooCommerce hook example: after an order completes, the plugin can auto-fire a "thanks for your order" message to the customer's WhatsApp (if they shared a number). Configure under WooCommerce → Order events.

Caching plugin compatibility

Aggressive caching plugins can break logged-in user identification by caching the widget snippet with a previous user's data. The plugin handles this correctly, but for caches with custom rules, configure:

Cache pluginSetting
WP RocketCache → Advanced → User Cache → enable. Or exclude the widget script from JS optimisation.
W3 Total CachePerformance → User Agent Groups → ensure logged-in users get separate cache.
LiteSpeed CacheCache → Browser → exclude pages with logged-in identification.
Cloudflare APOBypass cache for logged-in users (default behaviour with APO + WordPress).
Hostinger LiteSpeedSame as LiteSpeed — exclude logged-in cache.

Test it live

7

Verify in incognito

  1. Open your site in an incognito / private window (so you're not logged in).
  2. You should see the chat bubble in the corner.
  3. Click → welcome message appears.
  4. Send a test message → check MsgHub Inbox → Web Chat channel.
8

Verify logged-in identification

  1. Login to WordPress as a regular customer.
  2. Visit a front-end page → click the chat bubble.
  3. Send a message.
  4. In MsgHub Inbox: the conversation should show the customer's WordPress username and email, not "Anonymous visitor".

Shortcodes & programmatic control

Trigger from a button

[msghub_chat_button text="Chat with us"]

Renders a styled button. Clicking opens the chat widget.

Open with a pre-filled message

[msghub_chat_button text="Ask about this product" prefill="I have a question about {product_name}"]

WooCommerce-aware placeholders: {product_name}, {product_price}, {order_id}.

From custom JavaScript

// Open the widget
MsgHubWidget.open();

// Open with a pre-filled message
MsgHubWidget.open({ prefill: 'I want to schedule a demo' });

// Pass extra metadata about the visitor
MsgHubWidget.identify({
  customer_id: 'CUST-4821',
  segment:     'enterprise-trial',
  source:      'google-ads-campaign-spring'
});

Troubleshooting

Widget doesn't appear after install + activate

Widget appears but won't open when clicked

Logged-in user shows as "Anonymous" in MsgHub

WooCommerce orders not appearing in chat context

Widget conflicts with other chat plugins

"Failed to load widget script" error in console

FAQ

Is the plugin free?

Yes. The plugin itself is free on the WordPress directory. You need an active MsgHub tenant to use it. See pricing for tenant plans.

Does it work with WordPress.com hosted sites?

Only on Business plan and above (which allows custom plugins). WordPress.com Free and Personal don't support third-party plugins. Self-hosted WordPress (WordPress.org) always works.

Does it slow down my site?

No. The plugin enqueues a single small script (~24 KB gzipped) loaded asynchronously. It doesn't add database queries on the front-end, doesn't load on admin pages, and doesn't run unnecessarily. Lighthouse impact is negligible — typically <1 point.

Can I use it on a multisite WordPress network?

Yes. Network-activate the plugin, then configure per-site under each site's MsgHub Settings. Each site can have its own widget (separate MsgHub API key) or share one.

Will it work with my page builder (Elementor / Divi / Bricks)?

Yes — the widget is appended to the page body and is independent of your builder. The shortcode [msghub_chat_button] can be inserted via any builder's shortcode widget for trigger buttons.

Can I use multiple widgets on different parts of the site?

The plugin supports one widget per site (most sites want consistency). If you need different widgets per section, embed each via the raw HTML snippet on specific pages and disable the plugin's auto-inject globally.

Is my data sent to any third party other than MsgHub?

No. The plugin only communicates with app.msghub.info and your own WordPress database. No third-party analytics, no telemetry, no ads. See security architecture.

What's next

Web Chat Widget configuration
Customise the widget's look, welcome message, pre-chat form on MsgHub's side.
Train the AI on your products
Once installed, train the bot on your catalogue so it can answer product / pricing / shipping questions.
Plugin homepage
Release notes, changelog, advanced documentation.
Need install help?
Share your wp-admin URL and we'll walk through the install on a screen-share.