Title: wp_cache_get_salted
Published: February 24, 2026

---

# wp_cache_get_salted( string $cache_key, string $group, string|string[] $salt ): mixed|false

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_cache_get_salted/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_cache_get_salted/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_cache_get_salted/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_cache_get_salted/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_cache_get_salted/?output_format=md#changelog)

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

Retrieves cached data if valid and unchanged.

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

 `$cache_key`stringrequired

The cache key used for storage and retrieval.

`$group`stringrequired

The cache group used for organizing data.

`$salt`string|string[]required

The timestamp (or multiple timestamps if an array) indicating when the cache group(
s) were last updated.

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

 mixed|false The cached data if valid, or false if the cache does not exist or is
outdated.

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

    ```php
    function wp_cache_get_salted( $cache_key, $group, $salt ) {
    	$salt  = is_array( $salt ) ? implode( ':', $salt ) : $salt;
    	$cache = wp_cache_get( $cache_key, $group );

    	if ( ! is_array( $cache ) ) {
    		return false;
    	}

    	if ( ! isset( $cache['salt'] ) || ! isset( $cache['data'] ) || $salt !== $cache['salt'] ) {
    		return false;
    	}

    	return $cache['data'];
    }
    ```

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

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

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

Retrieves the cache contents from the cache by key and group.

  |

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

Find the post ID for redirecting an old slug.

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

Find the post ID for redirecting an old date.

  | 
| [WP_Term_Query::get_terms()](https://developer.wordpress.org/reference/classes/wp_term_query/get_terms/)`wp-includes/class-wp-term-query.php` |

Retrieves the query results.

  | 
| [WP_Network_Query::get_networks()](https://developer.wordpress.org/reference/classes/wp_network_query/get_networks/)`wp-includes/class-wp-network-query.php` |

Gets a list of networks matching the query vars.

  | 
| [WP_Site_Query::get_sites()](https://developer.wordpress.org/reference/classes/wp_site_query/get_sites/)`wp-includes/class-wp-site-query.php` |

Retrieves a list of sites matching the query vars.

  | 
| [WP_Comment_Query::get_comments()](https://developer.wordpress.org/reference/classes/wp_comment_query/get_comments/)`wp-includes/class-wp-comment-query.php` |

Get a list of comments matching the query vars.

  | 
| [wp_get_archives()](https://developer.wordpress.org/reference/functions/wp_get_archives/)`wp-includes/general-template.php` |

Displays archive links based on type and format.

  | 
| [WP_Query::get_posts()](https://developer.wordpress.org/reference/classes/wp_query/get_posts/)`wp-includes/class-wp-query.php` |

Retrieves an array of posts based on query variables.

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

Retrieves object IDs of valid taxonomy and term.

  | 
| [get_adjacent_post()](https://developer.wordpress.org/reference/functions/get_adjacent_post/)`wp-includes/link-template.php` |

Retrieves the adjacent post.

  | 
| [WP_User_Query::query()](https://developer.wordpress.org/reference/classes/wp_user_query/query/)`wp-includes/class-wp-user-query.php` |

Executes the query, with the current variables.

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

Gets the number of posts a user has written.

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

Gets the number of posts written by a list of users.

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

Retrieves a page given its path.

  |

[Show 9 more](https://developer.wordpress.org/reference/functions/wp_cache_get_salted/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_cache_get_salted/?output_format=md#)

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

| Version | Description | 
| [6.9.0](https://developer.wordpress.org/reference/since/6.9.0/) | Introduced. |

## User Contributed Notes

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