Using Gravity Forms ‘gform_stripe_enable_rate_limits’ PHP filter

The gform_stripe_enable_rate_limits filter enables or disables error rate limiting when processing a Stripe feed in Gravity Forms. Error rate limiting is enabled by default, blocking any IP that reaches 5 errors for an hour.

⚠️ This filter should only be used while testing your forms. Do not use this filter to disable error rate limiting with the Stripe add-on set to “Live” mode on the Forms > Settings > Stripe page. 

Error rate limiting prevents your forms with the Stripe add-on from being used for fraudulent card testing. Disabling it in a production environment may lead to processing transactions from fraudulent individuals testing stolen credit cards, resulting in potential card disputes.


add_filter('gform_stripe_enable_rate_limits', 'your_function_name');


  • $has_error (bool): Indicates whether error rate limiting is enabled. Defaults to false (error rate limiting enabled).
  • $form_id (int): The ID of the form being submitted.

More information

See Gravity Forms Docs: gform_stripe_enable_rate_limits

This filter was added in Stripe 3.4 and is located in class-gf-stripe.php.


Disable rate limiting for all forms

Disables error rate limiting for all forms.

add_filter('gform_stripe_enable_rate_limits', '__return_false');

Disable rate limiting for a specific form

Disables error rate limiting only for a specific form with the ID 5.

add_filter('gform_stripe_enable_rate_limits', 'disable_rate_limiting_for_form', 10, 2);
function disable_rate_limiting_for_form($has_error, $form_id) {
    if ($form_id == 5) {
        return false;
    return $has_error;

Enable rate limiting for a specific form

Enables error rate limiting only for a specific form with the ID 10.

add_filter('gform_stripe_enable_rate_limits', 'enable_rate_limiting_for_form', 10, 2);
function enable_rate_limiting_for_form($has_error, $form_id) {
    if ($form_id == 10) {
        return true;
    return $has_error;

Disable rate limiting if the user is an administrator

Disables error rate limiting if the current user is an administrator.

add_filter('gform_stripe_enable_rate_limits', 'disable_rate_limiting_for_admin', 10, 2);
function disable_rate_limiting_for_admin($has_error, $form_id) {
    if (current_user_can('administrator')) {
        return false;
    return $has_error;

Enable rate limiting based on a custom condition

Enables error rate limiting if a custom condition is met.

add_filter('gform_stripe_enable_rate_limits', 'custom_rate_limiting_condition', 10, 2);
function custom_rate_limiting_condition($has_error, $form_id) {
    // Replace this with your custom condition
    $my_condition = true;

    if ($my_condition) {
        return true;
    return $has_error;