add_action('woocommerce_single_product_summary', 'show_seo_title_in_html', 4);
function show_seo_title_in_html() {
global $post;
// Get SEO title from Rank Math
$seo_title = get_post_meta($post->ID, 'rank_math_title', true);
// Or fallback to Yoast SEO title
if (!$seo_title) {
$seo_title = get_post_meta($post->ID, '_yoast_wpseo_title', true);
}
// Output as hidden HTML or visible (as needed)
if ($seo_title) {
echo '