Introduction
Do you want to know how to change add to cart button text?
It’s not that simple to change the add to cart button. But we have some custom piece of code which can help you change the button text to your liking. Also, we have a plugin suggestion as well. Both the processes are simple. But one is better than the other.
We will be showing you how to add a custom piece of code to your WooCommerce site and change the text. This process, though a bit technical, is the better of the 2 processes we will be showing you.
So, let’s get started!
How to Change Add to Cart Button Text in WooCommerce: Adding Custom Code Snippets
There are two custom pieces of code you can add here. You can use both of these or either of these to change add to cart button text on your WordPress Store.
The first piece of text will show you how to change the text on a single product page. And the second one is to change the add to cart text on all product archive pages.
Adding both of these custom code pieces is the same. But first, you will need to install WooCommerce on your WordPress website.
How to Install WooCommerce on Your WordPress Site
In order to implement the solution on how to change add to cart Button Text in WooCommerce, you can/may have to install WooCommerce on your WordPress site first.
It’s a super simple process. All you have to do is follow these steps:
- Access your WordPress Dashboard.
- Go to Plugins and click on ‘Add New’.

- In the search box to the right type ‘WooCommerce’. The plugin should appear at the very top.
- Now all you have to do is click ‘Install’ and then ‘Activate’ the plugin.
***Now we believe it is safe to assume that you already have WooCommerce set up. If you haven’t already, then you can follow the above-mentioned steps.
Once you activate WooCommerce, the WooCommerce wizard will help you set up your storefront.
Now we are showing you how to add the WooCommerce add to cart button code snippets. So, for the sake of simplicity, we will be installing some sample data to WooCommerce and then show you how to add custom cart button text in WooCommerce shop page.
Generating Sample Data for WooCommerce Shop Page: Making Sure Everything Works!
This is more of a precautionary measure when it comes to the matter of how to change add to cart button text in WooCommerce. As mentioned earlier, we will be generating some sample WooCommerce products to show you the way to add WooCommerce add to cart button shortcode.
***Of course, you can choose to ignore this step and start building your WooCommerce store right away. But going through this precautionary measure will add to your WooCommerce Knowledge Library.
So, let’s see how you can add sample product data to your WooCommerce page:
- Search for WooCommerce on your WordPress dashboard. Click on it.
- Then click on ‘Status’.

- Then click on ‘Tools’ which should be at the top of the page.
- Now scroll down the page to find “Create default WooCommerece Pages”.

- Click on “Create Pages” which should be on the right.
You will now see a status bar somewhere on the top indicating that all missing WooCommerce pages were installed successfully.
Now, you need to follow these steps to complete the process:
- Search for “Tools” on Your WordPress dashboard.
- Then click on “Import”.

- Scroll down to find “WooCommerce Products (CSV)”.
- You will see a “Run Import” button. Click on it.
At this stage, the Importer will ask you to upload a CSV file. The easiest way to get this is by downloading the WooCommerce plugin from wordpress.org. Just download it to a folder in your computer and ‘Extract’ it.
Now:
- Go back to the Importer.
- Click on “Choose File”.
- You want to find the “Sample Products.csv” file. It should be under WooCommerce> Sample Data> Sample Products (CSV).

- Now click on ‘Continue’.
- Scroll down the next settings page and hit “Run the Importer”. You don’t need to change any settings here.
The importer will now add sample products to the sample pages. You now have a fully functional WooCommerce store for testing.
*** Again, you can ignore all these steps and go straight to changing the WooCommerce add to cart button, either on a single product page or all product category pages.
WooCommerce Text Change: How to Change Add to Cart Button Text in the Theme Editor
Before we begin, here is a quick disclaimer:
*** Be sure to be extra careful when adding extra bits of code to the theme files. If you add the code incorrectly, it may break your theme. Again, stay sharp!
- Go to your WordPress Dashboard. Make sure you’re logged in as the administrator.
- Now Go to Appearance> Theme Editor
- You should see the ‘Theme Files” on the right. In the Theme- files choose “Theme Functions” (there will be a label underneath saying functions.php).
- Now copy these codes at the end of the functions.php file:

- Here’s the code to change the add to cart WooCommerce button text in the shop/archive pages:
// Change "Add to Cart" > "Add to Bag" in Shop Page
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_shop_page_add_to_cart_callback' );
function woocommerce_shop_page_add_to_cart_callback() {
return __( 'Add to Bag', 'text-domain' );
}
- Here’s the code to change the add to cart button for a single product:
// Change "Add to Cart" > "Add to Bag" in Single Page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_single_page_add_to_cart_callback' );
function woocommerce_single_page_add_to_cart_callback() {
return __( 'Add to Bag', 'text-domain' );
}
- Now save the functions.php file by clicking on the “Update File” button. Again, be extra careful while doing this.

Now you can change the text to whatever you want. Just be cautious when changing the text.
Here’s the preview:
WooCommerce Add to Cart Button Text Change in the Archive Page:

WooCommerce Add to Cart Button Text Change in the Single Product Page:

How to Change the Add to Cart Button Text in WooCommerce Using a Plugin?
It is probably the more conventional way to change the add to cart text on you single Product WooCoomerce page or the archive product page.
Although it’s simple, it has a significant drawback. We will discuss it later on.
First, let’s see how you can use the “Add to Cart Button Custom Text” plugin to change the add to cart button text on your WooCommerce single product/product archive pages.
This plugin lets you change the texts on a single product page (you can change the different button texts) and the archive product pages (again, you can change the different button texts).
Here’s how to do it:
- In order to change the WooCommerce add to cart button text, you’ll need to have the plugin on your WordPress site. The installation process is simple, go to Plugins>Add New. Then write “Add to Cart Button Custom Text” in the Search Bar.
- The plugin should appear straight away. If not, then you can also download it from wordpress.org and add it to your WordPress site. All you have to do is hit the “Add New” button and upload the plugin from the download directory of your computer.
- Now “Install and Activate” the plugin.
- Once the WooCommerce add to cart button change plugin is ready for use, you need to navigate to Settings>Add to Cart Button to use the plugin.

In the “Add to Cart Button Custom Text Plugin”, you can change the WooCommerce single product button text or the button texts of the WooCommerce product archive pages. For both categories, you have the option to change:
- The Simple Product
- The Variable Product
- The External Product
- The Grouped Product
You can play with the different options. For our use case, if you change the “Simple Product Text” for either the single product page or the WooCommerce archive page, then you’ll see the change right away.
WooCommerce Add to Cart Button Change in Single Page:

WooCommerce Add to Cart Button Change in Product Archive Page:

Simple, right?
Not that simple!
You’re getting all these options with only a couple of clicks. So, there has to be a catch right!
There is!
You see, plugins like these do not add to the site loading speed. If anything, they make your WooCommerce e-store slower. And that’s something you don’t want!
If you have a lot of plugins on your WordPress site, then naturally the site loading speeds will take a hit. Because the job of a plugin is to load JavaScript files. If you have too many plugins on your WooCommerce store, then naturally, the loading effects of these plugins will add up, making your site slow!
Customers are not going to wait for your site to load and buy something from you. If you’re site loads slow, then there is a great possibility that your customer will find products elsewhere. Also, slow-loading e-commerce sites generally rank lower on Google SERPS.
It means you may go under the radar of the customer. Although you have something great to offer to the customer, because of a slow WooCommerce store, you won’t be able to reach them!
So, to improve site loading times, you’ll need to optimize your site, which can be cumbersome if you don’t know what you’re doing. As a whole, you’ll need to allot extra time to optimize your site and go through other (may be never-before-seen) processes.
So, What should I Do?
Although changing the source code of your theme can be risky, there’s a very small chance that it will slow your site down. So, we would advise you to stick with the code snippets.
It’s the best way to change the WooCommerce add to cart button text.
Yes, plugins are great. They are easy to use. However, the toll it takes on the site speed is just bad for business! And you don’t want that to happen.
Final Thoughts
You now know how to change add to cart button text in WooCommerce product pages. You know the way to change the WooCommerce button text by adding custom code snippets to the theme’s functions.php file.
You also know how you can use a plugin to change the add to cart text.
On top of all this, you know which option is better for your WooCommerce business.
So, we will leave the final choice in your hands. After all, you’re the one running the business online.
Good luck!
👉 Get ProductX to unlock all conversation-focused features and skyrocket your sales!
2 Comments
Leave a Reply
You must be logged in to post a comment.
some21
June 28, 2021Thank you for adding the video tutorial. It is very useful.
Sadik Ahmed
June 28, 2021We’re glad you like our post. Feel free to check out other relevant content in our blog. We have some very helpful content on WordPress plugins, especially PostX and ProductX.