diff --git a/wp-content/themes/3w-2025/inc/seo-class.php b/wp-content/themes/3w-2025/inc/seo-class.php index 3268492..88c7069 100644 --- a/wp-content/themes/3w-2025/inc/seo-class.php +++ b/wp-content/themes/3w-2025/inc/seo-class.php @@ -156,11 +156,17 @@ private function rank_math_active() { public function output_meta_tags() { $description = $this->get_meta_description(); $keywords = $this->get_meta_keywords(); + $rank_math = $this->rank_math_active(); echo "\n\n"; - echo '' . "\n"; - if (!empty($keywords)) { + // Rank Math emits its own description; a second tag lets Google pick the + // stale stored one, so only one emitter is allowed to run. + if (!$rank_math) { + echo '' . "\n"; + } + + if (!$rank_math && !empty($keywords)) { echo '' . "\n"; } diff --git a/wp-content/themes/3w-2025/inc/seo-remediation.php b/wp-content/themes/3w-2025/inc/seo-remediation.php index 4961681..6b93d26 100644 --- a/wp-content/themes/3w-2025/inc/seo-remediation.php +++ b/wp-content/themes/3w-2025/inc/seo-remediation.php @@ -13,7 +13,7 @@ * Purge stale full-page cache once when this remediation version ships. */ add_action( 'init', function () { - $cache_version = '2026-11-21-3'; + $cache_version = '2026-11-21-4'; if ( get_option( 'threew_seo_remediation_cache_version' ) === $cache_version ) { return; } @@ -263,6 +263,10 @@ function threew_2025_filter_guide_social_description( $content ) { return isset( $map[ $slug ] ) ? $map[ $slug ]['description'] : $content; } +// Rank Math resolves the meta description from stored post meta, which still +// carries the pre-remediation copy. This runs on its final-value filter. +add_filter( 'rank_math/frontend/description', 'threew_2025_filter_guide_social_description', 20 ); + add_filter( 'rank_math/opengraph/facebook/og_title', 'threew_2025_filter_guide_social_title', 20 ); add_filter( 'rank_math/opengraph/twitter/twitter_title', 'threew_2025_filter_guide_social_title', 20 ); add_filter( 'rank_math/opengraph/facebook/og_description', 'threew_2025_filter_guide_social_description', 20 );