Remove Apple Pay and Google Pay buttons from WooCommerce

When using the Stripe payment method for WooCommerce, you may want to remove the Payment Request buttons (such as Apple Pay and Google Pay) from single product pages.

This method ensures the Payment Request buttons are still available on the checkout page — it disables them on single product pages only. All other payment methods and credit cards still remain available to the user too.

To remove the Payment Request buttons, add this line of code to the functions.php file located in the root folder of your WordPress theme:

To avoid overwriting the file during upgrades, ensure you are using a child theme so that your edits persist.