Home / Blog / E-commerce
,

How to change add to cart text WooCommerce?

First published 14 Oct 2020. Tested again in November 2026 on WordPress 7.1.4, WooCommerce 11.2.2 and PHP 8.4.

Add to Cart

Are you looking for a way to change Add to Cart text in your WooCommerce store? Below are the two possible ways to change the text of the Add to Cart button to any text like Buy Now, Purchase Now, etc.

1. Custom Method

You can use the below code in the functions.php file of the active theme in your WooCommerce store.


// Function to change add to cart text on product archives pages
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );  
function woocommerce_custom_product_add_to_cart_text() {
    return __( 'Buy Now', 'woocommerce' );
}

// Change add to cart text on a single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' ); 
function woocommerce_custom_single_add_to_cart_text() {
    return __( 'Buy Now', 'woocommerce' ); 
}

2. Using WordPress Plugin

If you are not comfortable with the custom code, then you can use WordPress plugin Custom Add to Cart labels for WooCommerce to change the text of the Add to Cart buttons in your WooCommerce store.

The plugin lets you set a different Add to Cart label for archive pages and single product pages, per product type. You can set the Add to Cart labels in the separate setting screen in WooCommerce –> Settings –> Products tab –> Add to cart button labels.

Want this checked on your own site? See Exivon Tech’s Website & E-commerce Audit.

Dhiren Patel

Principal Full-Stack Engineer · Founder, Exivon Tech

I’ve built and run enterprise web platforms and e-commerce for 13 years, and I built ShieldScope, a free WordPress security scanner.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.