In a fast-paced digital shopping environment, speeding up the purchase process can significantly enhance customer satisfaction and increase conversion rates. Adding a “Buy Now” button to your WooCommerce store allows customers to bypass the traditional cart process and head straight to checkout with their chosen product. This tutorial will guide you through adding a “Buy Now” button directly to product pages in WooCommerce without the need for an additional plugin.
Why Add a Buy Now Button?
- Enhanced User Experience: Simplifies the checkout process, making it faster and more user-friendly.
- Increased Conversion Rates: Reduces the steps to purchase, potentially decreasing cart abandonment.
- Direct Sales Opportunities: Offers a direct route for users ready to purchase immediately, complementing the more traditional “Add to Cart” pathway.
Implementing a Buy Now Button in WooCommerce
Step 1: Add the Buy Now Button to Product Pages
First, we need to add the “Buy Now” button to each product page. This can be done by hooking into WooCommerce’s actions that output product page details.
/*
* Snippet: How to Add a Buy Now Button in WooCommerce Without a Plugin – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1237
* Tested with WooCommerce 10.7.0
* "Add a Buy Now button to WooCommerce product pages"
*/
function wcsuccess_add_buy_now_button() {
global $product;
echo '<form action="' . esc_url($product->add_to_cart_url()) . '" method="post">';
echo '<input type="hidden" name="quantity" value="1">';
echo '<input type="hidden" name="add-to-cart" value="' . esc_attr($product->get_id()) . '">';
echo '<button type="submit" class="single_add_to_cart_button button alt">Buy Now</button>';
echo '</form>';
}
add_action('woocommerce_after_add_to_cart_button', 'wcsuccess_add_buy_now_button');
This snippet adds a “Buy Now” button right after the “Add to Cart” button on product pages. The form directs straight to the checkout page by using the product’s unique add_to_cart_url().
Step 2: Redirect to Checkout
By default, adding an item to the cart redirects the user to the cart page. We need to change this behavior so that clicking the “Buy Now” button will redirect users directly to the checkout.
/*
* Snippet: How to Add a Buy Now Button in WooCommerce Without a Plugin – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1237
* Tested with WooCommerce 10.7.0
* "Redirect Buy Now action directly to checkout"
*/
function wcsuccess_redirect_to_checkout() {
$url = WC()->cart->get_checkout_url();
wp_redirect($url);
exit;
}
add_action('woocommerce_add_to_cart_redirect', 'wcsuccess_redirect_to_checkout');
This code checks if an item was added to the cart and redirects to the checkout instead of the cart page.
Step 3: Test the Buy Now Button
- Functional Testing: Ensure that the “Buy Now” button adds the item to the cart and redirects to the checkout page as expected.
- Compatibility Testing: Test with different products (simple, variable, etc.) to ensure compatibility.
- User Experience Testing: Conduct user testing to gather feedback on the new checkout flow.
Conclusion
Adding a “Buy Now” button to your WooCommerce store simplifies the purchasing process, providing a quick and easy way for customers to complete their purchases. By following the steps outlined above, you can implement this feature without the need for additional plugins, keeping your site lightweight and focused.
Further Enhancements
- Personalization: Consider customizing the button for specific products or scenarios based on user behavior or preferences.
- Analytics: Implement tracking for the “Buy Now” button to analyze its impact on sales and user behavior compared to the standard “Add to Cart” pathway.
I have been working with WordPress and WooCommerce since 2012 and have developed a deep knowledge of the content management system. Since 2012, I have developed several plugins and designed dozens of websites utilising different frameworks, CMS’s and programming languages. I am proficient in PHP, Python, Java, C, C++, R and JavaScript with limited experience in Go, Kotlin and Swift.
Educationally, I have a Master’s degree in cyber security a Bachelor’s (Hons, First Class) in Applied Research and a Graduate Certificate in Data Science. I’m currently undertaking PhD studies investigating IoT cybersecurity. I recently graduated with First Class Honours and Masters of Information Technology, receiving the Executive Dean’s Award for studies undertaken in the 2021 and 2022 academic years. I have worked in the information technology industry for the past 11 years primarily as a software/web developer specific to design, optimisation, network management and security. My research interests are in the areas of Internet of Things (IoT), 5G and Beyond Networks, information security for wireless networks and software development.
Stay In Touch

