Title: Wrong language permalink with WPML
Last modified: November 4, 2016

---

# Wrong language permalink with WPML

 *  Resolved [vmweb](https://wordpress.org/support/users/vmweb/)
 * (@vmweb)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/wrong-language-permalink-with-wpml/)
 * Hi,
    I’m working with WPML plugin version 3.5.3.1 on my website. There are 3 
   languages: english, italian and japanese.
 * When I search something in english I would like to find results in all languages.
   So in Relevanssi options I unchecked “Limit results to current language”.
 * It seems work good and I find results in all languages. But when I click on an
   another language post, it opens current language translation of that post. I 
   would like it opens the correct language version instead.
 * For example:
    In english I search “mercato centrale”. It found an italian post
   named “mercato centrale” but the permalink of the listed post is that of the 
   english version: [http://mywebsite.com/en/central-market](http://mywebsite.com/en/central-market)
   instead of: [http://mywebsite.com/it/mercato-centrale](http://mywebsite.com/it/mercato-centrale)
 * Can you help me please?
 * Best regards

Viewing 1 replies (of 1 total)

 *  Thread Starter [vmweb](https://wordpress.org/support/users/vmweb/)
 * (@vmweb)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/wrong-language-permalink-with-wpml/#post-8397098)
 * Sorry, it wasn’t a problem with Relevanssi.
    I resolved the issue switching language
   before printing the post permalink.
 * If it can help someone here the code:
 *     ```
       $wpml_info = wpml_get_language_information($post->ID);
       $post_language = $wpml_info['language_code'];
       $sitepress->switch_lang($post_language, true);
       get_template_part('templates/content', 'search');
       $sitepress->switch_lang(ICL_LANGUAGE_CODE, true);
       ```
   
 * Best regards

Viewing 1 replies (of 1 total)

The topic ‘Wrong language permalink with WPML’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [vmweb](https://wordpress.org/support/users/vmweb/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/wrong-language-permalink-with-wpml/#post-8397098)
 * Status: resolved