Change "Place order" button text on WooCommerce Checkout page

In this tutorial I am going to show you a couple ways how you can change checkout button text. But please note, that this text can be changed dynamically depending on a payment method selected. We will also cover that below.

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/woocommerce/place-order-button-text.html#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>' . $order_button_text . '</button>';

Change Button Text for Payment Gateways

This one will be a little tricky πŸ‘½ First of all, your custom payment gateway may 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/woocommerce/place-order-button-text.html#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( 'Proceed to PayPal' == $translated_text ) {
		$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 you would like to override like “Proceed to PayPal” could be used somewhere else on your website. If so, just add a condition.

Misha Rudrastyh

Misha Rudrastyh

Hey guys and welcome to my website. For more than 10 years I've been doing my best to share with you some superb WordPress guides and tips for free.

Need some developer help? Contact me

Follow me on X