Website Building » WooCommerce » How Do I Change the Buy Now Button in WooCommerce?

How Do I Change the Buy Now Button in WooCommerce?

Last updated on January 12, 2023 @ 6:08 pm

If you’re running a WooCommerce store, you might want to change the default “Buy Now” button text to something else. Maybe you want it to say “Add to Cart” or “Purchase Now”.

Whatever the reason, changing the text is easy to do with a few lines of code.

Here’s how:

  1. In your WordPress admin panel, go to Appearance > Editor. This will take you to the theme editor.
  2. On the right hand side, look for the “Theme Functions” (functions.php) file and click on it.
  3. Scroll down to the very bottom of the file and add the following code:
function wc_change_buy_now_button_text() {
return 'Add to Cart'; }
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wc_change_buy_now_button_text' );

The code above will change the “Buy Now” button text to “Add to Cart”.

To change the button text to something else, simply replace the word “Add” in the code above with whatever text you want.

PRO TIP: If you are not careful, changing the “Buy Now” button in WooCommerce can break your store. Make sure you have a backup before proceeding.

Conclusion

You can easily change the default “Buy Now” button text in WooCommerce by following a few simple steps. First, go to Appearance > Editor in your WordPress admin panel. Then, look for the “Theme Functions” (functions.php) file and click on it.

Next, scroll down to the bottom of the file and add the following code:
function wc_change_buy_now_button_text() {
return ‘Add to Cart’; }
add_filter( ‘woocommerce_product_single_add_to _cart’, ‘wc _change _buy _now _button _text’ );

This will change the button text to “Add to Cart”. You can also change it to say something else by replacing the word “Add” in the code with whatever text you want. Just remember to save your changes before exiting the editor!

Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.