WPIntell

Source evidence

Product short description and Redis cache

SearchWP Live Ajax Search · support · 2026-02-24T09:21:00+00:00

complaintsentiment
mediumseverity
0.81relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

3 / 22 rows with source links

13.6% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

19 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
tuomovitikainen unresolved
Hi, I’m seeing a weird issue with SearchWP Live Ajax Search and Redis cache on WooCommerce products. When I do the search for a product that has no short description, the live search somehow causes Redis to cache an auto-generated excerpt (taken from the long description). When I enter the products admin page, the short description is there. If I flush Redis cache, the auto-generated short description disappears, which confirms it’s only in cache until someone saves the product. This only happens with Redis enabled – our staging without Redis works fine. The search request seems to be triggering WordPress to auto-generate excerpts from get_the_excerpt() , and Redis is caching that modified product object. Hi @tuomovitikainen , Our team reviewed the issue you reported, and here are our findings: When SearchWP Live AJAX Search renders results, it calls WordPress’s get_the_excerpt() for each entry. For WooCommerce products without a short description, WordPress automatically generates an excerpt from the full description. This process can modify the product’s post object in memory. When Redis is used, this modified object may be stored in the persistent object cache, which can lead to incorrect or unexpected excerpts appearing. On servers without Redis, the in-memory cache is cleared after each request, so the issue does not occur. To resolve this, you can use the following hook. It replaces get_the_excerpt() with WooCommerce’s get_short_description() , which retrieves the stored value directly and avoids modifying the post object: add_filter( 'searchwp_live_search_results_entry_data', function( $data, $result ) { if ( ! ( $result instanceof WP_Post ) ) { return $data; } if ( $result->post_type !== 'product' || ! function_exists( 'wc_get_product' ) ) { return $data; } $product = wc_get_product( $result->ID ); if ( ! $product ) { return $data; } $data['content'] = $product->get_short_description(); return $data; }, 10, 2 ); You can add this code to your theme’s functions.php file or by using a code snippet plugin. After adding the snippet, please perform a Redis cache flush to clear any previously cached excerpts. Then test the search again and let me know how it goes.

Comments

1 shown
Karan 2026-05-01T13:29:00+00:00

Hi @tuomovitikainen , Our team reviewed the issue you reported, and here are our findings: When SearchWP Live AJAX Search renders results, it calls WordPress’s get_the_excerpt() for each entry. For WooCommerce products without a short description, WordPress automatically generates an excerpt from the full description. This process can modify the product’s post object in memory. When Redis is used, this modified object may be stored in the persistent object cache, which can lead to incorrect or unexpected excerpts appearing. On servers without Redis, the in-memory cache is cleared after each request, so the issue does not occur. To resolve this, you can use the following hook. It replaces get_the_excerpt() with WooCommerce’s get_short_description() , which retrieves the stored value directly and avoids modifying the post object: add_filter( 'searchwp_live_search_results_entry_data', function( $data, $result ) { if ( ! ( $result instanceof WP_Post ) ) { return $data; } if ( $result->post_type !== 'product' || ! function_exists( 'wc_get_product' ) ) { return $data; } $product = wc_get_product( $result->ID ); if ( ! $product ) { return $data; } $data['content'] = $product->get_short_description(); return $data; }, 10, 2 ); You can add this code to your theme’s functions.php file or by using a code snippet plugin. After adding the snippet, please perform a Redis cache flush to clear any previously cached excerpts. Then test the search again and let me know how it goes.