Title: wp_nonce_tick
Published: April 25, 2014
Last modified: February 24, 2026

---

# wp_nonce_tick( string|int $action = -1 ): float

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#wp--skip-link--target)

Returns the time-dependent variable for nonce creation.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#description)󠁿

A nonce has a lifespan of two ticks. Nonces in their second tick may be updated,
e.g. by autosave.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#parameters)󠁿

 `$action`string|intoptional

The nonce action.

Default:`-1`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#return)󠁿

 float Float value rounded up to the next highest integer.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#source)󠁿

    ```php
    function wp_nonce_tick( $action = -1 ) {
    	/**
    	 * Filters the lifespan of nonces in seconds.
    	 *
    	 * @since 2.5.0
    	 * @since 6.1.0 Added `$action` argument to allow for more targeted filters.
    	 *
    	 * @param int        $lifespan Lifespan of nonces in seconds. Default 86,400 seconds, or one day.
    	 * @param string|int $action   The nonce action, or -1 if none was provided.
    	 */
    	$nonce_life = apply_filters( 'nonce_life', DAY_IN_SECONDS, $action );

    	return ceil( time() / ( $nonce_life / 2 ) );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/pluggable.php#L2438)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/pluggable.php#L2438-L2451)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#hooks)󠁿

 [apply_filters( ‘nonce_life’, int $lifespan, string|int $action )](https://developer.wordpress.org/reference/hooks/nonce_life/)

Filters the lifespan of nonces in seconds.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#related)󠁿

| Uses | Description | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

| Used by | Description | 
| [wp_verify_nonce()](https://developer.wordpress.org/reference/functions/wp_verify_nonce/)`wp-includes/pluggable.php` |

Verifies that a correct security nonce was used with time limit.

  | 
| [wp_create_nonce()](https://developer.wordpress.org/reference/functions/wp_create_nonce/)`wp-includes/pluggable.php` |

Creates a cryptographic token tied to a specific action, user, user session, and window of time.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | Added `$action` argument. | 
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/wp_nonce_tick/?output_format=md#comment-content-5067)
 2.   [Roy Orbitson](https://profiles.wordpress.org/lev0/)  [  5 years ago  ](https://developer.wordpress.org/reference/functions/wp_nonce_tick/#comment-5067)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_nonce_tick%2F%23comment-5067)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_nonce_tick%2F%23comment-5067)
 4. The mathematics of this function actually only guarantees a nonce’s lifespan to
    be _half_ of the `nonce_life` filtered value but _may_ be up to that value (minus
    1 second), depending on the time of day it was generated.
 5. [See my comment on verifying nonces](https://developer.wordpress.org/reference/functions/wp_verify_nonce/#comment-5066).
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_nonce_tick%2F%3Freplytocom%3D5067%23feedback-editor-5067)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_nonce_tick%2F)
before being able to contribute a note or feedback.