This thread is resolved. Here is a description of the problem and solution.
Problem:
The client was experiencing issues with Yoast SEO displaying raw keys instead of proper titles on Finnish product pages, brands not appearing on automatically translated product pages, and SUMO Reward Points messages displaying as raw keys on Finnish pages.
Solution:
1. To address the Yoast SEO issue, we recommended deactivating WPML Multilingual CMS and WPML SEO, then clearing the cache and ensuring the correct tags are added to Yoast.
2. For the SUMO Reward Points, we provided a custom filter to translate the messages based on the language:
add_filter( 'option_rs_message_for_single_product_point_rule', function( $value ) {<br /> if ( $value === 'rs_message_for_single_Tuote_point_rule' || empty( $value ) ) {<br /> return defined( 'ICL_LANGUAGE_CODE' ) && ICL_LANGUAGE_CODE === 'en'<br /> ? 'Buy this product and earn [rewardpoints] points ([equalamount])'<br /> : 'Osta tämä tuote ja ansaitse [rewardpoints] pistettä ([equalamount])';<br /> }<br /> return $value;<br />}, 999 );3. For the brand issue, a one-time script was used to sync brands across translations:
add_action( 'admin_init', function() {<br /> if ( ! current_user_can( 'manage_options' ) ) {<br /> return;<br /> }<br /> $products = get_posts( array(<br /> 'post_type' => 'product',<br /> 'posts_per_page' => -1,<br /> 'post_status' => 'any',<br /> 'fields' => 'ids',<br /> ) );<br /> if ( empty( $products ) ) {<br /> return;<br /> }<br /> foreach ( $products as $product_id ) {<br /> $brands = wp_get_object_terms( $product_id, 'product_brand', array(<br /> 'fields' => 'ids',<br /> ) );<br /> if ( empty( $brands ) || is_wp_error( $brands ) ) {<br /> continue;<br /> }<br /> $trid = apply_filters( 'wpml_element_trid', null, $product_id, 'post_product' );<br /> if ( ! $trid ) {<br /> continue;<br /> }<br /> $translations = apply_filters( 'wpml_get_element_translations', null, $trid, 'post_product' );<br /> if ( empty( $translations ) ) {<br /> continue;<br /> }<br /> foreach ( $translations as $translation ) {<br /> if ( (int) $translation->element_id === (int) $product_id ) {<br /> continue;<br /> }<br /> wp_set_object_terms(<br /> $translation->element_id,<br /> $brands,<br /> 'product_brand',<br /> false<br /> );<br /> }<br /> }<br /> update_option( 'rs_brand_sync_done', time() );<br />} );If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
This topic contains 9 replies, has 0 voices.
Last updated by 2 weeks, 4 days ago.
Assisted by: Carlos Rojas.



