How it Works

If a user has X failed payments without a successful order in between, their subscription is canceled.

Video Demo

Installation

  1. Upload the pmpro-failed-payment-limit.php to the /wp-content/plugins/ directory of your site.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.

Then, set the rule to cancel membership after X failed payments. After installing and activating the plugin, you must set a constant for ‘PMPRO_FAILED_PAYMENT_LIMIT’ (either in your theme’s functions.php file or helper customizations plugin) for the number of failures.

define('PMPRO_FAILED_PAYMENT_LIMIT', 3);

Note: Many Payment Gateways have their own way to cancel a recurring subscription after a certain amount of failed payments. Be sure to check with your payment gateway to confirm that your failed payment limit does not conflict with the settings to handle failed payments on subscriptions in your gateway account. With Stripe, you can log into your account and go to Settings > Manage failed payments.