On this page
What this issue is
A click-to-chat link such as https://wa.me/15551234567?text=Hi%2C%20I%20am%20interested%20in%20the%20Blue%20Chair opens WhatsApp with a message already typed. The part after text= is the prefilled message. Two things commonly go wrong.
Why it costs you leads or sales
The visitor has already decided to talk to you. If the message names the wrong product, your team answers about the wrong item, or has to ask again, and some people give up. A garbled or truncated message looks careless and can hide the product name entirely. Your team then loses the context that would let them reply quickly and close the sale.
- Product pageVisitor views the Red Sofa
- Tap WhatsApp buttonLink built with a fixed product name
- Message opensSays Blue Chair, or is cut off
- Sales replyWrong or unclear answer
The click works, but the message that arrives is wrong, so the conversation starts badly.
How to check if your site has it
Open several product pages
Pick at least three different products, plus a page with special characters in the name (an ampersand, accent, quote or emoji).
Tap the WhatsApp button on a phone
Read the message that appears in the WhatsApp chat box before you send. Does it name the right product? Is it complete and readable?
Inspect the link
On desktop, right-click the button, choose Inspect and read the href. Look for the text parameter. Raw spaces,
&or#inside the text are a sign of broken encoding.Compare with the page
Check that the product name in the link matches the page title. Also check the button in the header, footer and any floating widget, as each may use different text.
Broken
- href has text=Hi, I want the Blue Chair & a quote
- Message is cut off at the & sign
- Same text on every product page
Fixed
- href has text=Hi%2C%20I%20want%20the%20Red%20Sofa%20%26%20a%20quote
- Full message appears in WhatsApp
- Product name comes from the current page
How to fix it
The rule is simple: build the text from the current page, then encode it once. Do not type the percent codes by hand for dynamic values, and do not encode twice, which turns %20 into %2520.
const phone = '15551234567'; // international format, digits only
const product = document.querySelector('h1').textContent.trim();
const message = 'Hi, I am interested in ' + product + ' (' + location.href + ')';
const url = 'https://wa.me/' + phone + '?text=' + encodeURIComponent(message);
document.querySelectorAll('a.whatsapp-button').forEach(a => a.href = url);Find the button source
Check your chat plugin settings, theme header or page builder widget. Many plugins have a default message field.
Use a dynamic value
If the plugin supports placeholders for the page title, use them. Otherwise, in PHP use
rawurlencode( get_the_title() )when building the link.Remove copied links
Replace hard-coded buttons pasted into individual pages with one template-based button.
Edit the theme code
In Online Store > Themes > Edit code, open the product template or section that holds the button.
Use Liquid with the url_encode filter
Build the text from
product.titleand pass it throughurl_encode, as in the snippet below.
Create a Custom HTML tag
Fire it on All Pages (or product pages) with a script like the JavaScript example above, using your button class.
Preview and test
Use Preview mode and confirm the href changes on each product page.
Use a CMS-bound link
On the CMS template page, set the link URL with the product name field inserted, or add a small custom code embed that runs the JavaScript above.
Check special characters
Webflow does not encode inserted field values for you in a link, so use the script to encode them.
Encode on the server or in the browser
Use
encodeURIComponentin JavaScript,rawurlencodein PHP orurllib.parse.quotein Python. Encode only the text value, not the whole URL.Use UTF-8
Make sure the page is served as UTF-8 so accents and emoji encode correctly.
{% assign wa_text = 'Hi, I am interested in ' | append: product.title | append: ' ' | append: shop.url | append: product.url %}
<a class="whatsapp-button" href="https://wa.me/15551234567?text={{ wa_text | url_encode }}">Chat on WhatsApp</a>How to confirm it's fixed
- Message names the correct product on at least three product pages
- Names with &, #, quotes, accents and emoji show correctly
- Message is not cut off and has no %20 or + signs
- Header, footer and floating buttons all match
- Tested on iPhone, Android and WhatsApp Web on desktop
How to prevent it happening again
Use one shared template or script for all WhatsApp buttons rather than pasting links into pages. Add a step to your launch checklist for new products and redesigns: tap the button and read the message. When you rename a product or change themes, test again, since template changes often reset button text.
How FunnelGuard handles this
FunnelGuard detects this issue only partly. Its check for the click-to-chat step is a prefilled text assert: the robot visitor opens your page, finds the WhatsApp link and checks that the prefilled text in the link matches what you expect. That catches a missing, changed or visibly broken message on the journeys you set up.
Questions people ask
Why is my WhatsApp prefilled message cut off?
Most likely the text contains an unencoded & or #. These characters have special meaning in a URL, so everything after them is dropped. Encode the message with encodeURIComponent or urlencode and it will appear in full.
Why does my WhatsApp message show weird characters?
Accents or emoji were not encoded as UTF-8 percent codes, or the text was encoded twice. Encode the raw text once, using UTF-8, and avoid pasting already encoded text into a tool that encodes it again.
How do I add a space or line break in a wa.me text parameter?
Use %20 for a space and %0A for a line break. In code, encodeURIComponent turns spaces into %20 and newlines into %0A for you.
Why does my WhatsApp button mention the wrong product?
The link probably has hard-coded text copied from another page, or sits in a shared header, footer or widget with fixed text. Build the message from the current page title or product name instead.
How do I make the WhatsApp message use the current product name?
Insert the product title dynamically, with Liquid on Shopify, a placeholder in your plugin, or JavaScript reading the page heading. Then URL-encode it before adding it after text=.
Can I check WhatsApp prefilled messages automatically?
Partly. A monitoring tool such as FunnelGuard can assert that the prefilled text in the link matches what you expect on the journeys you configure. It does not read the chat box inside the WhatsApp app, so test a few products by hand too.
Is there a length limit for the WhatsApp text parameter?
WhatsApp does not publish a firm limit for the prefilled text, but very long URLs can fail in some browsers and apps. Keep the message short, such as a greeting, the product name and the page link.
Related issues
- CNV-260Prefilled WhatsApp message missingFix guide
- CNV-258WhatsApp link opens wrong numberFix guide
- CNV-263WhatsApp link uses api.whatsapp.com form that breaks on desktopFix guide
- CNV-268WhatsApp click not trackedFix guide
- CNV-262WhatsApp button hidden on mobileFix guide
- CNV-259WhatsApp number no longer on WhatsAppFix guide