Article

How to Add a Waitlist to WooCommerce (Back-in-Stock)

Add a waitlist to WooCommerce with a Custom HTML block, a footer plugin, or a product-page hook for back-in-stock notifications. Child-theme safe, step-by-step.

AAymane E.October 4, 20268 min read
Share
A retail storefront, representing a back-in-stock waitlist on a WooCommerce store

WooCommerce is WordPress, so the usual WordPress methods apply — but WooCommerce has a specific, high-value use case: a back-in-stock waitlist. When a product sells out, you can collect emails and notify buyers the moment it returns. GetWaitly's widget handles the list, referrals, and emails.

Here is how to add a waitlist to WooCommerce, both as a page-level form and on product pages.

The short answer

Add the widget with a WordPress Custom HTML block or a footer plugin for a general waitlist, or hook it into product pages from functions.php for a back-in-stock list. Load the widget script once, then place the container div where it belongs. Total time: 5–10 minutes.

What you need

  • A GetWaitly account with a waitlist created (free plan covers 100 subscribers).
  • Your waitlist's public ID from the Widget/Embed section of the dashboard.
  • A WordPress site running WooCommerce, with access to Appearance → Theme File Editor (or FTP/SSH) if you use the product-page hook. A child theme is strongly recommended so theme updates do not erase your code.

Step 1 — Get your embed code

In GetWaitly, open the waitlist and go to Widget. Copy:

Script tag:

<script src="https://getwaitly.com/widget.js" defer></script>

Container div:

<div class="gw-widget" data-waitlist-id="YOUR_WAITLIST_ID"></div>

Use the waitlist's public ID, not the URL slug.

Option A — A waitlist page (simplest)

This is the standard WordPress approach, and it works on any WooCommerce store.

  1. Create a page (for example, "Coming soon" or "Join the waitlist").
  2. Add a Custom HTML block and paste both lines:
<div class="gw-widget" data-waitlist-id="YOUR_WAITLIST_ID"></div>
<script src="https://getwaitly.com/widget.js" defer></script>
  1. Publish and link to the page from your store navigation, homepage, or a product notice.

If you use WooCommerce's Coming soon site visibility, you can edit the Coming Soon template (in the block editor / Site Editor, if your version provides it) and drop the same Custom HTML block into it so visitors on the holding page can join.

Option B — Load the script site-wide

If you will show the widget on several pages or product pages, load the script once to avoid repeating it.

With a plugin: Install WPCode or Insert Headers and Footers, and paste the script into the Footer section (before </body>):

<script src="https://getwaitly.com/widget.js" defer></script>

Then place only the container div where you want the form.

Without a plugin: Add the script to your (child) theme's functions.php:

add_action( 'wp_footer', function () {
    echo '<script src="https://getwaitly.com/widget.js" defer></script>';
} );

Option C — Back-in-stock waitlist on product pages

To show the waitlist on products that are out of stock, hook into the single product template from your child theme's functions.php.

First, load the script (Option B), then add this:

add_action( 'woocommerce_after_single_product_summary', function () {
    if ( ! is_product() ) {
        return;
    }

    global $product;
    if ( ! $product || $product->is_in_stock() ) {
        return; // Only show when the product is out of stock.
    }

    echo '<div style="margin-top:24px;">
            <h3>Get notified when this is back in stock</h3>
            <div class="gw-widget" data-waitlist-id="YOUR_WAITLIST_ID"></div>
          </div>';
}, 15 );

To show it on every product page regardless of stock, remove the is_in_stock() check.

Important: edit a child theme, not the parent theme. Theme updates overwrite parent files. If you cannot use functions.php, use the plugin route in Option B and place the div with a page builder or shortcode instead.

The popup variant

For a button that opens the form in a modal, load the script (Option B) and add a trigger where you want it:

<button class="gw-trigger" data-waitlist-id="YOUR_WAITLIST_ID">Join waitlist</button>

This works well in a notice bar, header, or product summary.

Step 4 — Test it

Publish, open the product or page in a private window, and submit a test email. Confirm the subscriber appears in your GetWaitly dashboard. Test an out-of-stock product specifically, since that is where the hook fires.

WooCommerce-specific notes

  • One script per page. If you add the script in wp_footer and a Custom HTML block, the widget can initialize twice. Load it in one place.
  • Child theme. Any functions.php edit belongs in a child theme.
  • Product variation stock. $product->is_in_stock() reflects the parent product; for variable products you may need to check individual variations. For a simple "notify me" list, the parent check is usually enough.
  • Cache. Store pages are often cached aggressively. If the widget does not appear, purge the cache or exclude the page.

FAQ

Does GetWaitly work with WooCommerce?

Yes. WooCommerce runs on WordPress, so the widget embeds with a Custom HTML block or footer plugin. For product pages, hook woocommerce_after_single_product_summary in your child theme.

How do I add a back-in-stock waitlist to WooCommerce?

Load the widget script once, then echo the container div on out-of-stock product pages from your child theme's functions.php using the woocommerce_after_single_product_summary hook. GetWaitly collects the emails and lets you broadcast when the product is back.

Can I add the waitlist to WooCommerce's Coming soon page?

If your WooCommerce version has the Coming Soon template, edit it in the block editor and add a Custom HTML block with the widget. Otherwise, create a normal page with the widget and set it as your holding/coming-soon page.

Do I need a plugin to embed the waitlist?

No. A Custom HTML block on a page is enough. A footer plugin is only useful if you want the script loaded site-wide. Some stores use a plugin instead of editing functions.php for the product-page hook.

Will the widget slow down my store?

No. The script is small and loaded with defer, so it does not block rendering. Load it from one place only.

Can I collect more than email?

Yes. Enable name, phone, or custom fields in your GetWaitly widget settings, and the form renders them. For back-in-stock lists, an email field is usually enough.

Related guides

The simple, affordable waitlist for indie hackers. Start free in 5 minutes — no credit card required. Try GetWaitly free →

Aymane E.

Written by

Aymane E.

Founder of GetWaitly. I write about validating ideas, pre-launch, and growth from building a waitlist tool as a solo founder.

Follow on X →

Build your waitlist in 5 minutes

GetWaitly handles signups, referrals, broadcast emails, and analytics — free to start.