How to Remove “What is PayPal?” from WooCommerce Checkout
Introduction:
WooCommerce, the leading e-commerce platform built on WordPress, seamlessly integrates with PayPal to provide customers with a secure and familiar payment gateway. However, on the checkout page, some users might find the “What is PayPal?” link next to the PayPal payment option distracting or unnecessary. This link usually directs customers to a PayPal page explaining the basics of the service. While helpful for some, it can clutter the checkout experience and potentially lead to confusion or abandonment for others. This article will guide you through the process of removing the “What is PayPal?” link from your WooCommerce checkout, helping you streamline the payment process and potentially improve conversion rates. We’ll explore a simple code snippet solution that doesn’t require advanced coding knowledge.
Main Part:
Understanding the Issue
The “What is PayPal?” link is often added by the PayPal plugin you are using with WooCommerce. It aims to educate customers who may be unfamiliar with PayPal. However, for a majority of online shoppers who already know what PayPal is, it adds unnecessary visual clutter and an extra click to understand something they already Check out this post: How To Translate Woocommerce understand. Removing it can lead to a cleaner, more focused checkout experience.
Removing the Link: The Code Snippet Solution
The most straightforward way to remove the “What is PayPal?” link is by using a custom code snippet. Here’s how to do it:
1. Accessing Your Theme’s `functions.php` File: The first step is to access your theme’s `functions.php` file. Always create a child theme before making any changes to the `functions.php` file directly. This will prevent your changes from being overwritten when your theme updates. You can usually access and edit this file through your WordPress dashboard under Appearance > Theme File Editor (after activating a child theme). *Be extremely careful when editing this file, as errors can break your site.*
2. Adding the Code Snippet: Add the following code snippet to your `functions.php` file, preferably at the end:
function remove_paypal_what_is_it( $checkout ) { ?> #payment .payment_method_paypal p a { display: none !important; } <?php } add_action( 'woocommerce_review_order_before_payment', 'remove_paypal_what_is_it' ); add_action( 'woocommerce_thankyou', 'remove_paypal_what_is_it' );
3. Explanation of the Code:
- `function remove_paypal_what_is_it( $checkout ) { … }`: This defines a function named `remove_paypal_what_is_it` that will contain our code to remove the link.
- `
…`: This block contains CSS code that will be applied to the checkout page.
- `#payment .payment_method_paypal p a { display: none !important; }`: This CSS rule targets the anchor tag (`a`) within the paragraph (`p`) inside the element with the class `payment_method_paypal` which is inside of the payment section `#payment`. `display: none !important;` hides the link. The `!important` tag ensures that this style overrides any other styles that might be trying to display the link.
- `add_action( ‘woocommerce_review_order_before_payment’, ‘remove_paypal_what_is_it’ );`: This line hooks our function `remove_paypal_what_is_it` into the `woocommerce_review_order_before_payment` action hook. This ensures that the code is executed right before the payment options are displayed on the checkout page.
- `add_action( ‘woocommerce_thankyou’, ‘remove_paypal_what_is_it’ );`: This applies the same CSS to the thank you page to ensure the link is also gone there in case it somehow showed Discover insights on How To Temporarily Hide Categories In Woocommerce up after the payment.
Read more about How Do I Add Ninja Form To Woocommerce
4. Save the `functions.php` File: After adding the code, save the changes to your `functions.php` file.
5. Clear Your Website Cache: Important! Many WordPress sites use caching plugins. After making changes to your code, clear your website cache (including any WooCommerce or browser cache) to ensure that the changes are reflected on your website.
6. Test the Checkout: Visit your WooCommerce checkout page and verify that the “What is PayPal?” link is no longer visible next to the PayPal payment option.
Alternatives to Editing `functions.php`
* Code Snippets Plugin: Instead of directly editing the `functions.php` file, you can use a plugin like “Code Snippets.” This plugin allows Check out this post: How To Set Woocommerce Product To Selected Country you to add, manage, and activate code snippets without modifying your theme files, making it a safer and more organized approach. Simply install and activate the Code Snippets plugin, create a new snippet, paste the code above, and activate the snippet.
* Custom CSS (Less Recommended): Discover insights on How To Hide Cart In Woocommerce While the above method is preferred, you could potentially hide the link using custom CSS added through the WordPress Customizer (Appearance > Customize > Additional CSS). However, the above code is more robust because it includes PHP, ensuring the CSS is properly loaded on specific WooCommerce pages.
Conclusion:
Removing the “What is PayPal?” link from your WooCommerce checkout is a simple modification that can subtly improve the user experience and potentially contribute to increased conversion rates. By using the provided code snippet and following the steps outlined in this article, you can easily customize your checkout page to better suit your customers’ needs and create a more streamlined purchasing process. Remember to always back up your website before making any code changes, and use a child theme to protect your customizations during theme updates. Enjoy a cleaner and more efficient checkout process!