---
id: gform_state_lifespan
title: "Filter - gform_state_lifespan"
sidebar_label: "gform_state_lifespan"
---

# Filter: gform_state_lifespan

:::info[Dynamic Hook Name]

This hook supports dynamic naming with the following modifiers:

1. `$form_id`


**Example hook names:**
- `gform_state_lifespan` (base hook)
- `gform_state_lifespan_1` (with first modifier value)
:::

Allows the state lifespan to be customized.

## Parameters

| Name | Type | Description |
|------|------|-------------|
| $lifespan | `int` | The state lifespan in seconds. Default is 172800 seconds (2 days). |
| $form_id | `int` | The ID of the form the state is for. |

### Since

- next: next

### Source

Defined in `includes/form-display/state/class-state-handler.php` at line 401

