Skip to main content
Login Join
Snippet · PHP

Change WooCommerce Add to Cart Button Text

Shared by Amit Dholiya · July 14, 2026 · @woocommerce_product_single_add_to_cart_text, woocommerce_product_add_to_cart_text

6 views
Back to Snippets

Steps

  1. Open functions.php.
  2. Add the code below.
  3. Save the file.

Done — the default “Add to Cart” text will be replaced with “Buy Now”.

function custom_add_to_cart_text() {
    return 'Buy Now';
}

add_filter(
    'woocommerce_product_single_add_to_cart_text',
    'custom_add_to_cart_text'
);

add_filter(
    'woocommerce_product_add_to_cart_text',
    'custom_add_to_cart_text'
);
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments