Forum Replies Created

Viewing 1 replies (of 1 total)
  • I think I have found a solution for myself, maybe someone will help.I found the yoast re-index hook, gave it a lower priority than the plugin. And after that I manually update the required meta field. I take the translation values ​​from _yoast_wpseo_title since it is the most relevant there.

    
    add_action( 'wpseo_save_indexable', function ($updated_indexable, $old_indexable) {
        global $wpdb;
        $yoastTitle = $wpdb->get_results("SELECT meta_value FROM $wpdb->postmeta WHERE (meta_key = '_yoast_wpseo_title' AND post_id = '". $updated_indexable->object_id ."')");
        if (isset($yoastTitle[0])) {
            $postMetaTitle = $yoastTitle[0]->meta_value;
            $wpdb->query("UPDATE wp_yoast_indexable SET title='{$postMetaTitle}' WHERE object_id={$updated_indexable->object_id}");
        }
    }, 15, 3);
    

    this is a very primitive solution but it works.
    You can correct it for yourself. it even works for me with wp yoast index –reindex .

Viewing 1 replies (of 1 total)