Why it matters
- The "message us on WhatsApp" button is a main contact route on Gulf websites; when it does not work, the customer does not reach you, and you may never know they tried.
- WhatsApp documents one format for chat links: the full international number, digits only, without a plus sign, leading zeros, brackets or dashes.
- Links in other forms are not guaranteed to work: depending on the form and the app, WhatsApp may show an error or fail to find the account.
Example
<a href="https://wa.me/+968 9123-4567">فرع مسقط</a>
<a href="https://wa.me/96891234567?text=%D9%85%D8%B1%D8%AD%D8%A8%D8%A7%D8%8C%20%D8%A3%D8%B1%D9%8A%D8%AF%20%D8%A7%D9%84%D8%A7%D8%B3%D8%AA%D9%81%D8%B3%D8%A7%D8%B1%20%D8%B9%D9%86%20%D8%B7%D9%84%D8%A8">فرع مسقط</a>
How to fix
Write the full international number, digits only: the country code, then the number without its local 0.
html
<!-- Omani local number: 9123 4567 -->
<a href="https://wa.me/96891234567">Message us on WhatsApp</a>
<!-- Saudi local number: 050 123 4567 → 966 then 501234567 -->
<a href="https://wa.me/966501234567">Message us on WhatsApp</a>- Gulf country codes: Saudi Arabia
966, UAE971, Oman968, Kuwait965, Bahrain973, Qatar974. - For a prefilled message, add
?text=with URL-encoded text, such ashttps://wa.me/96891234567?text=%D9%85%D8%B1%D8%AD%D8%A8%D8%A7("مرحبا", hello). - With
api.whatsapp.com/send?phone=links, the same rule applies to thephonevalue.
How we detect
- We collect the page's links (
<a>and<area>) towa.me/<number>,wa.me/c/<number>,api.whatsapp.com/send?phone=,web.whatsapp.com/send?phone=orwhatsapp://send?phone=. Links without a number, such aswa.me/message/…, are not checked. - We decode the number and check, in order: Eastern Arabic or Persian digits, then any character other than 0–9, then a leading zero.
- We check that it is a possible international number: a known country code and a length that fits that country's numbers, using the numbering-plan data of the libphonenumber-js library, which is based on Google's data.
- When the local 0 follows the country code (such as
9660501234567), we give the correct form.
We do not check whether the number has a WhatsApp account, because that would mean contacting WhatsApp.