The WPFolks app is out on iPhone and Android. Free, no ads. Download on the App Store Get it on Google Play
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

37 views
1 upvote
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

Proudly supported by