Change "Place order" button text on WooCommerce Checkout page

Sometimes you may want to change standard checkout button texts like "Place order", "Proceed to PayPal" etc. In this tutorial I will show you a couple ways to do that.

#WooCommerce, #checkout  / 

Please note, that this text changes dynamically depending on a payment method selected:

How to change the text on the Place Order button in WooCommerce checkout
As you can see I’ve already changed the text to "Submit"

Theoretically if you know about WooCommerce template structure, you can replace button text in this file:

  • templates
    • checkout
      • payment.php

But please do not do it ๐Ÿ™, because there is a hook for that. Even two. I will show you both of them.

Method 1. Change button text with woocommerce_order_button_text hook #

The most simple way, just copy this code to your current theme functions.php file (but better โ€“ย a child theme or a custom plugin, otherwise you will lose your changes every time after your theme received an update).

/**
 * @snippet       Change "Place Order" Button text @ WooCommerce Checkout
 * @sourcecode    https://rudrastyh.com/?p=8327#woocommerce_order_button_text
 * @author        Misha Rudrastyh
 */
add_filter( 'woocommerce_order_button_text', 'misha_custom_button_text' );
 
function misha_custom_button_text( $button_text ) {
   return 'Submit'; // new text is here 
}

You can also change button text if a specific product is in the cart, or if products from specific categories are in the cart etc.

add_filter( 'woocommerce_order_button_text', 'misha_custom_button_text_for_product' );
 
function misha_custom_button_text_for_product( $button_text ) {
 
	$product_id = 18; // a specific product ID you would like to check
 
	if( WC()->cart->find_product_in_cart( WC()->cart->generate_cart_id( $product_id ) ) ) {
		$button_text = 'Submit';
	}
 
	return $button_text;
 
}

Method 2. Change button text with woocommerce_order_button_html hook #

Using this method, our main goal is to replace it with str_replace() PHP function in woocommerce_order_button_html filter hook. Here is how to do it:

add_filter( 'woocommerce_order_button_html', 'misha_custom_button_html' );
 
function misha_custom_button_html( $button_html ) {
	$button_html = str_replace( 'Place order', 'Submit', $button_html );
	return $button_html;
}

The hook woocommerce_order_button_html accepts only one parameter which is the button HTML. This hook also allows you to create the button HTML from scratch.

$order_button_text = 'Submit';
$button_html = '<button type="submit" class="button alt" name="woocommerce_checkout_place_order" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>';

Change Button Text for Payment Gateways #

This one will be a little tricky ๐Ÿ‘ฝ First of all, your custom payment gateway could not have a hook for that and second โ€“ย of course you can not make changes directly in payment gateway plugin files.

So, what to do? JavaScript? Of course, no! ๐Ÿ˜ฑ

Even if a payment gateway doesn’t have a hook for that, it must support localization. So, gettext hook will help us in this case.

/**
 * @snippet       Change "Proceed to PayPal" Button text @ WooCommerce Checkout
 * @sourcecode    https://rudrastyh.com/?p=8327#payment_gateways_text
 * @author        Misha Rudrastyh
 */
add_filter( 'gettext', 'misha_custom_paypal_button_text', 20, 3 );
 
function misha_custom_paypal_button_text( $translated_text, $text, $domain ) {
 
	if( $translated_text == 'Proceed to PayPal' ) {
		$translated_text = 'Pay with PayPal'; // new button text is here
	}
 
	return $translated_text;
}

You can apply this code for any payment gateway, just check how it renames the button in English and use that phrase in the above code on line 10.

Change Proceed to PayPal button text

And please be careful because the string your would like to override like "Proceed to PayPal" could be used somewhere else on your website. If so, just add a condition.

Misha Rudrastyh
About the author Misha Rudrastyh

Passionate about WordPress and snowboarding, creating websites for over 9 years! Let's work together — just contact me.

If you are a developer too, subscribe to my facebook page.

Leave your question or feedback

phpjsHTMLCSSSQLCode
Please, enter a comment
Please, enter a name
Incorrect email