Solve WooCommerce PayPal auto-return problem

Solved WooCommerce PayPal Auto-return
Solved WooCommerce PayPal Auto-return

On PayPal site the return link after payment uses your PayPal business e-mail address (this is the merchant, or receiver PayPal e-mail address) for the title of the link and not the title of your website. It is confusing for the users (especially in case of digital products, because download links are located on your website, so it is important to navigate back there).

CBT PayPal argument determines the title of this link. This argument should be passed to PayPal by WooCommerce, but this not happen.
The little code below passes this parameter to PayPal, and resolves the issue.

Insert the following script into your functions.php file, located in your active theme’s directory.

/*Resolve WooCommerce PayPal return link title problem*/
add_filter( ‘woocommerce_paypal_args’, ‘woocommerce_paypal_args_repair’);
function woocommerce_paypal_args_repair( $paypal_args ) {
if (!array_key_exists(‘cbt’,$paypal_args))
$paypal_args[‘cbt’] = get_option( ‘blogname’ );
return $paypal_args;

8 thoughts on “Solve WooCommerce PayPal auto-return problem”

  1. Great hint – but there’s a nasty bug with it that took me 8 hours to solve.

    The ‘woommerce_paypal_args’ and ‘woocommerce_paypal_args_repair’ strings in the “add_filter(…)” command don’t gave have single quotes around them. They presumably have those fancy variants at a slight angle.

    So if you copy/paste the code, PHP sees these strings as “undefined constants”. And the “add_filter()” command silently fails.

  2. Hi, I’m running woocommerce 2.1.12 version and I try to follow your post but is not working.
    The paypal page continues says “return to site: site_email_address” (instead of url website)

    Please can you help me to resolve this problem?

  3. Hi Davide!

    We use the code you can see, and it is working for us.
    Can you send a screenshot about where the following text appears: “return to site: site_email_address”? Does this text displayed on the PayPal button?

    This row set the title of the button you can see in the pictur:
    $paypal_args[‘cbt’] = get_option( ‘blogname’ );

    If you would like other title, you can modify this program line like this:
    $paypal_args[‘cbt’] = ‘My PayPal Return Button Title’ ;


  4. Hi, i tried also the code but it does not work for me either..
    “$paypal_args[‘cbt’] = ‘My PayPal Return Button Title’ ;” does not work also for me.
    Please someone help, this is an annoying problem xD

  5. Hi Nomikos,

    Please give more information about the problem.
    What is your site URL, where we can see it?

    Are you sure you write this code into functions.php file on the directory of your active theme? If you write the following line into your functions.php, does a TEST title appear on your pages?




Leave a Comment