Background: My website has 2 languages - en (default) and th language is separated by “folder” while default language has no indication. I have custom shortcodes that adds links to related posts / objects. I use those shortcodes inside php templates and directly on the page. Issue: When using the shortcode inside the editor in both languages, links works correctly so when I define in the shortcode PHP a link to: /review/post-name the links are replaced to th/คาสิโนรีวิว/ (notice both the addition of th prefix and the translation of the review string). When using the shortcode inside the php template, links are not translated and the prefix is not added so the links are basically broken all over the site. Note: this was 100% working about 6 - 12 months ago - so i’m not sure if it’s wordpress OR wpml bug. shortcode code: ob_start(); include(get_stylesheet_directory().'/shortcodes/templates/casinos-cards.php'); } $output = ob_get_clean(); return $output; casinos-cards.php main code: while ( $casinos_pods->fetch() ) { $casino_id = $casinos_pods->field ('ID'); if ( ! empty( $casino_id ) ) { $casino_name = $casinos_pods->field( 'post_title' ); $casino_review_url = '/review/'.$casinos_pods->field( 'post_name' ).'/'; $casino_score = $casinos_pods->field ('editor_score'); $casino_pros = $casinos_pods->field ('pros'); $casino_image = get_the_post_thumbnail_url($casino_id, 'thumbnail', true); if (!$casino_image) { $casino_image = get_site_url().'/wp-content/themes/rehub/images/default/noimage_500_500.png'; } $casino_url = '/go/'.$casinos_pods->field ('main_bonus.post_name'); $main_bonus_id = $casinos_pods->field('main_bonus.ID'); $main_bonus_category = get_the_terms($main_bonus_id,'thirstylink-category'); $main_bonus_category = $main_bonus_category[0]->slug; $main_bonus_text = $casinos_pods->field ('main_bonus.bonus_description'); $main_bonus_short_text = $casinos_pods->field ('main_bonus.short_description'); $main_button_text = $casinos_pods->field ('main_bonus.button_text'); $casino_badge_name = $casinos_pods->field('casino_badge.name'); $casino_badge_color = $casinos_pods->field('casino_badge.badge_color'); } ?> so, the casino review url code is always: $casino_review_url = '/review/'.$casinos_pods->field( 'post_name' ).'/'; and on pages, it knows to render it correctly (adding TH and translating review category) while on PHP templates it doesn’t When calling the shortcode from the classic editor it works correctly: [casinos template='cards' limit='5']แนะนำคาสิโนที่ชื่นชอบ[/casinos] When calling the shortcode from the php template the links rendered are not translated: <?php echo do_shortcode( '[casinos template="cards" limit="4"]'.__('Other Favorite Casinos','sfgroup').'[/casinos]' );?> I tried understanding the language from php, but the difference between how wordpress is rendering the links makes it unscalable, as if calling it from the page itself I will need to ignore it from php any suggestions will be greatly appreciated