Change the “Add to Cart” Button Text in WooCommerce
One of the most common requests is that users want to change the “Add to Cart” text on their WooCommerce installations. Although there isn’t a built-in way to do this, we can achieve it through some quick functions – just copy the text below into your functions.php
file. Then, change the “Buy Now” text to whatever you’d like to display.
Change Text on Single Product Pages
The following function will change the button text on single product pages.
add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' );// < 2.1
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' );// 2.1 +
function woo_custom_cart_button_text() {
return __( 'Buy Now', 'woocommerce' );
}
Change Text on Product Archives / Shop Page
The following function will change the button text on archive pages like the Shop page or category pages. It can be used in conjunction with the function above.
add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' );// < 2.1
add_filter( 'woocommerce_product_add_to_cart_text', 'woo_custom_cart_button_text' );// 2.1 +
function woo_custom_cart_button_text() {
return __( 'Buy Now', 'woocommerce' );
}
Have any questions or comments about this article, or ways you think it can be improved?
Join the conversation in the comments below, or sign up for my newsletter to recieve periodic updates!
It worked. Thank you!
I’m glad it helped! If you have any specific requests for follow-up guides, let me know 🙂
If you feel you can install : https://wordpress.org/plugins/woo-button-text/ this plugin do its duty to easily change the button name.