remove what is paypal

WooCommerce, remove what is PayPal

Do you want to Remove What is Paypal link from checkout page?

It’s such a minor thing to fix. It is basically there to tell new users about PayPal but who don’t know what is PayPal these days? So why not just remove it

How to REMOVE WHAT IS PAYPAL

Let’s see how to remove what is PayPal link. I will share two methods to fix it. One is Paypal and other is through CSS if you prefer that way.

PHP Code Snippet

You need to add code snippet in your theme’s functions.php file. If you are not using child theme I would recommend using a code snippet plugin instead.

add_filter( 'woocommerce_gateway_icon', 'wpglorify_remove_what_is_paypal', 10, 2 );
 
function wpglorify_remove_what_is_paypal( $icon_html, $gateway_id ) {
if( 'paypal' == $gateway_id ) {
   $icon_html = '<img src="/wp-content/plugins/woocommerce/includes/gateways/paypal/assets/images/paypal.png" alt="PayPal Acceptance Mark">';
}
return $icon_html;
}

The above code will remove the ‘what is Paypal’ and cards image next to it and output Paypal Logo next to its label.

It will look like this after you add the snippet.

Hide with CSS

If you don’t want to do it via PHP for some reason this CSS code will come handy. Add the following CSS code in Customize > Additional CSS.

a.about_paypal {
    display: none;
}

Now, this method will not remove the link from source code instead just hide it from users. Though it does the trick.

It will look like this after you add the CSS.

remove what is paypal with css

I personally will not recommend using php snippet to remove it completely from the source code.

HOW TO ADD PHP CODE

The Code Snippets plugin makes it very easy to not just add PHP snippets to your website but also manage all the snippets you add.

You can activate and deactivate certain snippets, and even adds notes about what they do. It even has better error handling to avoid the PHP error scenarios.

To install it, simply go to Plugins > Add New and search for Code Snippets.

The traditional or normal way to add PHP snippets to your theme is to add directly in your theme’s functions.php file.

However, make sure you are using a child theme otherwise you will lose all changes once you update your theme.

4 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *