How to Change the “Add to Cart” Text in WooCommerce Using functions.php
WooCommerce is one of the most powerful eCommerce plugins for WordPress. However, many store owners want to customize certain elements of their online store to better match their brand or improve conversions.
One common customization is changing the default “Add to Cart” button text.
For example, you may want to use:
- Buy Now
- Order Now
- Get Yours Today
- Purchase Now
Changing this text can improve customer engagement and make your call-to-action more persuasive.
In this tutorial, we will show you how to easily change the “Add to Cart” button text in WooCommerce using the functions.php file.
Why Change the Add to Cart Text?
The default WooCommerce button text works fine, but customizing it can provide several benefits:
1. Improve Conversions
More action-driven text like “Buy Now” or “Order Today” can encourage faster purchase decisions.
2. Match Your Brand Voice
Your store may require more unique wording that aligns with your brand personality.
3. Better Customer Experience
Clear and compelling call-to-action buttons help guide users through the buying process.
Important Before You Start
Before editing your functions.php file:
- Always create a backup of your website.
- Use a child theme so changes are not lost during theme updates.
You can find the file here:
Appearance → Theme File Editor → functions.php
Or via FTP:
/wp-content/themes/your-theme/functions.php
Code to Change WooCommerce Add to Cart Text
Add the following code to your functions.php file.
// Change "Add to Cart" on Single Product Page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_single_add_to_cart_text' );
function custom_single_add_to_cart_text() {
return __( 'Buy Now!', 'woocommerce' ); // Replace 'Buy Now!' with your text
}
// Change "Add to Cart" on Product Archives (Shop page)
add_filter( 'woocommerce_product_add_to_cart_text', 'custom_archive_add_to_cart_text' );
function custom_archive_add_to_cart_text() {
return __( 'Buy Now!', 'woocommerce' ); // Replace 'Buy Now!' with your text
}
What This Code Does
The code above modifies the WooCommerce button text in two places:
1. Single Product Page
woocommerce_product_single_add_to_cart_text
This filter changes the button text shown on the individual product page.
2. Shop / Category Pages
woocommerce_product_add_to_cart_text
This filter changes the button text shown on:
- Shop page
- Product category pages
- Product archive pages
Customizing the Text
Simply replace “Buy Now!” with any text you want.
Examples:
return __( 'Order Now!', 'woocommerce' );
or
return __( 'Get Yours Today!', 'woocommerce' );
After saving the file, refresh your website and the button text will be updated instantly.
Final Thoughts
Changing the Add to Cart button text in WooCommerce is a simple yet powerful way to improve your store’s user experience and increase conversions.
By using a small snippet in the functions.php file, you can fully customize the call-to-action text across your entire store.
If you frequently customize WooCommerce, consider storing your custom snippets in a site-specific plugin or using a plugin like Code Snippets to keep your changes organized and safe.
Need more WooCommerce customization tips?
Stay tuned for more practical WordPress and WooCommerce guides.







