### [How to Exclude Failed Payments From PayPal Inside Form Locker Settings](https://wpforms.com/developers/how-to-exclude-failed-payments-from-paypal-inside-form-locker-settings/)

**Published:** September 29, 2023
**Author:** Editorial Team

**Excerpt:** This article will give you a snippet so that you can exclude failed payments from the PayPal Standard addon affecting your Form Locker settings?

**Content:**

## Overview

Are you looking to exclude failed payments from the **PayPal Standard addon**  affecting your **Form Locker** settings? By default, the **Form Locker addon** doesn’t consider payment statuses from any integrated payment gateway in your forms. However, with a quick code snippet, you can effortlessly exclude failed and even pending payments, ensuring that your form isn’t restricted for these types of submissions. We’ll guide you through the straightforward process to achieve this seamlessly!

## Adding the snippet

Simply add this snippet to your site. If you need guidance in how to add snippets to your site, [please review this tutorial](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms").

```

/**
 * Exclude pending and failed payments from PayPal with Form Locker Entry Limit option
 *
 * @link https://wpforms.com/developers/how-to-exclude-failed-payments-from-paypal-inside-form-locker-settings/
 */

function wpf_dev_exclude_payment_status( $statuses ) {
	
	// Exclude failed payments from form locker settings
	$statuses[] = 'failed';
	// Exclude pending payments from form locker settings
	$statuses[] = 'pending';
	
	return $statuses;
}
add_filter( 'wpforms_locker_lockers_entry_limit_exclude_not_allowed_entries_excluded_statuses', 'wpf_dev_exclude_payment_status', 10, 1 );
```

This filter will automatically exclude any `failed` or `pending` **PayPal Standard** payments from affecting the Entry Limit you have set in your Form Locker settings.

And that’s it! Would you like to also control the **Form Locker addon** settings for the password? Take a look at our [How to Make the Form Locker Password Non-Case Sensitive](https://wpforms.com/developers/how-to-make-the-form-locker-password-non-case-sensitive/ "How to Make the Form Locker Password Non-Case Sensitive").

## Related

Filter Reference: [wpforms\_locker\_lockers\_entry\_limit\_exclude\_not\_allowed\_entries\_excluded\_statuses](https://wpforms.com/developers/wpforms_locker_lockers_entry_limit_exclude_not_allowed_entries_excluded_statuses/ "wpforms_locker_lockers_entry_limit_exclude_not_allowed_entries_excluded_statuses")

## FAQ

#### Q: Can I use this for PayPal Commerce addon?

**A:** Not at this time.

**Categories:** Snippets

**Tags:** Form Locker Addon, PayPal Standard, PHP

---

