From 76b5a3c3330116be48b16f4509adb2930314408c Mon Sep 17 00:00:00 2001 From: Axiom Date: Thu, 20 Aug 2026 17:21:11 -0700 Subject: [PATCH] Purge stale cache after SEO remediation --- .../themes/3w-2025/inc/seo-remediation.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/wp-content/themes/3w-2025/inc/seo-remediation.php b/wp-content/themes/3w-2025/inc/seo-remediation.php index a256766..a02da99 100644 --- a/wp-content/themes/3w-2025/inc/seo-remediation.php +++ b/wp-content/themes/3w-2025/inc/seo-remediation.php @@ -9,6 +9,24 @@ exit; } +/** + * Purge stale full-page cache once when this remediation version ships. + */ +add_action( 'init', function () { + $cache_version = '2026-08-20-1'; + if ( get_option( 'threew_seo_remediation_cache_version' ) === $cache_version ) { + return; + } + + if ( class_exists( 'LiteSpeed_Cache_API' ) ) { + LiteSpeed_Cache_API::purge_all(); + } else { + do_action( 'litespeed_purge_all' ); + } + + update_option( 'threew_seo_remediation_cache_version', $cache_version, false ); +}, 1 ); + /** * Return the selected guide metadata keyed by post slug. *