Title: wp_ai_client_cache_group
Published: August 20, 2026

---

# apply_filters( ‘wp_ai_client_cache_group’, string $group )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/wp_ai_client_cache_group/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_ai_client_cache_group/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_ai_client_cache_group/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_ai_client_cache_group/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_ai_client_cache_group/?output_format=md#changelog)

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

Filters the cache group used by the WP AI Client cache adapter.

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

Allows integrators to change the object cache group under which AI client items 
are stored. This is useful for avoiding key collisions, creating environment-specific
caches, or adapting to backend constraints.

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

 `$group`string

The cache group.

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

    ```php
    return (string) apply_filters( 'wp_ai_client_cache_group', self::CACHE_GROUP );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/ai-client/adapters/class-wp-ai-client-cache.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/ai-client/adapters/class-wp-ai-client-cache.php#L51)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/ai-client/adapters/class-wp-ai-client-cache.php#L51-L51)

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

| Used by | Description | 
| [WP_AI_Client_Cache::get_cache_group()](https://developer.wordpress.org/reference/classes/wp_ai_client_cache/get_cache_group/)`wp-includes/ai-client/adapters/class-wp-ai-client-cache.php` |

Retrieves the cache group used for cache operations, applying a filter for customization.

  |

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

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

## User Contributed Notes

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