Back to Community

How to Customize the WooCommerce Add to Cart Button Text in Storefront

40 threads Sep 9, 2025 ThemeStorefront

Content

Customizing the text on your 'Add to Cart' buttons is a common request for WooCommerce store owners using the Storefront theme. Whether you want to change it to 'Buy Now', 'Purchase', or something more specific like 'Buy Unbranded', a simple code snippet can get the job done. This guide will walk you through the process.

The Problem

By default, WooCommerce displays the generic 'Add to Cart' text on product buttons. Many store owners find this text doesn't fit their brand voice or the specific action they want customers to take. You might want to change the text on single product pages, archive pages, or both.

The Solution: Using a Custom Code Snippet

The most reliable way to change this text is by adding a small piece of PHP code to your site. This method is preferred over direct translation plugins, as it is more permanent and less likely to cause conflicts.

Step 1: Access Your Functions File
You will need to add this code to your theme's functions.php file. It is highly recommended to do this using a child theme to prevent your changes from being overwritten when the parent theme updates. Alternatively, you can use a plugin like 'Code Snippets' to manage custom code safely.

Step 2: Add the Code
Copy and paste the following code snippet. You can change the text 'Buy Unbranded' to whatever you prefer.

// Change add to cart text on single product pages
add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_single_add_to_cart_text' );
function custom_single_add_to_cart_text() {
    return __( 'Buy Unbranded', 'woocommerce' );
}

// Change add to cart text on product archives/collection pages
add_filter( 'woocommerce_product_add_to_cart_text', 'custom_product_add_to_cart_text' );
function custom_product_add_to_cart_text() {
    return __( 'Buy Unbranded', 'woocommerce' );
}

Step 3: Save and Test
After saving the file, clear any caching on your site and then visit a product page to see the new text in action.

Important Considerations

  • Child Theme: As mentioned, always use a child theme for customizations. This protects your changes during theme updates.
  • Syntax: Ensure the code is copied exactly, with correct punctuation and no missing characters, to avoid causing a white screen of death or other errors on your site.
  • Translation:

By following these steps, you can easily tailor your store's call-to-action buttons to better suit your brand and improve the customer experience.

Related Support Threads Support