Add a WhatsApp booking form to WordPress

Published Updated 3 min read

Cabin owners, tour operators, coaches and other service businesses take bookings on WhatsApp because that is where their customers already are. A contact form that sends an email puts the enquiry in an inbox while the customer moves on. What they need is a form that drops the visitor into a WhatsApp conversation with the details already typed.

WhatsApp's open redirect URL does that without API access or a business account. A wa.me link takes a phone number and an optional message; open it and WhatsApp launches with the message pre-filled, ready to send to your number. A form that collects the details, checks the dates and builds that link is about sixty lines of PHP and JavaScript, with no database writes, settings page or admin menu.

The format is wa.me/[phone number]?text=[URL-encoded message]. The number is in international format without the plus sign: a UK number starting 07 becomes 447..., a US number 1555.... Leave out text and WhatsApp opens a blank conversation; include it and the message sits typed in the input box, ready but not sent.

The visitor still taps Send. That works in your favour: they check the details before committing, the message comes from their own WhatsApp account rather than a form email from your server, and the conversation sits in your WhatsApp inbox with every other booking.

One shortcode, a different number per page

[whatsapp_booking phone="15551234567"] renders a small form: name, check-in date, check-out date, number of guests and an optional message. On submit, JavaScript checks that check-in comes before check-out and shows an inline error if not. If the dates are fine, it builds the wa.me URL with every value encoded into the message and opens it in a new tab, so the booking page stays open.

The number lives in the shortcode, so one plugin can serve several pages with different numbers: one for accommodation, one for activities, one for a second property.

On a phone with WhatsApp installed the link opens the app; on a desktop it opens WhatsApp Web, and a visitor not logged in there is asked to scan a QR code. Submit the form once yourself to see the message arrive with everything the visitor typed.

Businesses that run on their phone

Cabin rentals, holiday lets, guided tours, personal trainers, photographers, music tutors, driving instructors: anywhere the owner answers enquiries on their phone and WhatsApp is what they actually watch. If the current flow is fill in a form, wait for an email, wait for a reply to the reply, this swaps the waiting for a conversation that starts immediately.

It sits happily beside a normal contact form too. Put both on the Contact page and let visitors choose WhatsApp or email.

Availability, records and deposits happen elsewhere

There is no calendar of taken dates. The enquiry goes to WhatsApp and whether the dates are free is a conversation you have there. If availability has to be enforced, Amelia or WooCommerce Bookings handle it.

Nothing is stored in WordPress, so there is no record for reporting or a CRM beyond your WhatsApp history. Gravity Forms with a notification addon stores the submission and forwards it to WhatsApp if you need both. A follow-up message can add a step that emails you each submission before the redirect.

Deposits or full payment at booking time are outside it entirely. That points to WooCommerce with a bookings extension.

What you get

Included

  • Shortcode that renders a booking form with name, check-in date, check-out date, number of guests, and an optional message field
  • Client-side date validation that shows an inline error if check-out is before check-in, without a page reload
  • wa.me URL construction with all form values URL-encoded into a pre-filled message, opened in a new tab
  • Configurable WhatsApp number via shortcode attribute, supporting multiple numbers across one site

Not included

  • Availability calendar: the plugin has no concept of which dates are already booked
  • Submission storage: form data goes directly to WhatsApp and is not written to the WordPress database
  • Email confirmation to the visitor after they submit
  • Payment or deposit collection at booking time
  • WhatsApp Business API: this uses the open wa.me redirect URL, which requires no API key or verified business account

Contact Form 7 does the things on the right. This build covers the part most sites use.

Questions

Do I need a WhatsApp Business account?

No. The wa.me link works with any WhatsApp account, personal or business. WhatsApp Business adds a business profile and automated replies, but neither is needed here.

What format should the phone number be in?

International format with no plus sign and no spaces. A UK number +44 7911 123456 becomes 447911123456; a US number +1 555 123 4567 becomes 15551234567.

Build it in Steem

The button opens the builder with this guide's prompt filled in, so you can change anything before it runs. Nothing is built, and nothing is charged, until you send it.

Build this pluginAbout 55 credits. The free plan includes enough for one.
Read the prompt (205 words)

Build a WordPress plugin that adds a shortcode [whatsapp_booking phone=""] to any page or post. The shortcode renders a booking form with five fields: Name (text input, required), Check-in Date (date input, required), Check-out Date (date input, required), Number of Guests (number input, min 1 max 20, required), and Message (textarea, optional, placeholder 'Any questions or special requests'). On submit, use JavaScript to validate that the Check-in Date is before the Check-out Date. If not, display an inline error message below the date fields without reloading the page. If validation passes, build a URL in the format https://wa.me/[phone]?text=[URL-encoded message], where the message is a plain-text multi-line string with labels for each field value formatted as: 'Hi, I would like to make a booking:\nName: [name]\nCheck-in: [date]\nCheck-out: [date]\nGuests: [n]\nMessage: [message]'. Open this URL in a new browser tab using window.open. Enqueue the JavaScript with wp_enqueue_script. The phone number is read from the shortcode attribute. Sanitize all inputs on the PHP side with sanitize_text_field before outputting them to the page. Do not write anything to the database. Do not add a settings page or admin menu. Add minimal inline CSS so the form is usable without any theme dependency: a simple stacked label-input layout with a submit button.