Title: Custom Permalinks + Wpml Plugin
Last modified: January 30, 2017

---

# Custom Permalinks + Wpml Plugin

 *  Resolved [mike1707](https://wordpress.org/support/users/mike1707/)
 * (@mike1707)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/)
 * Hello,
 * we have some issues with Custom Permalinks and WPML plugin.
    If we use both of
   them we get an error and the translated page doesn’t work anymore.
 * Is the plugin no longer compatible with WPML?
 * Thanks in advance.
 * Best regards

Viewing 15 replies - 1 through 15 (of 27 total)

1 [2](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/page/2/?output_format=md)

 *  Plugin Author [Sami Ahmed Siddiqui](https://wordpress.org/support/users/sasiddiqui/)
 * (@sasiddiqui)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8716113)
 * HI Mike,
 * The plugin does not compatible with WPML. This is an known and reported issue.
 * We will fix this but, cannot give you a time frame at this stage.
 * Regards,
    Sami
 *  [netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/)
 * (@netzwerkstudio)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8816667)
 * Hi there,
 * is there any news on that topic?
 * WPML and Custom permalinks worked fine until the last update.
    I would really
   appreaciate a suggestion on how long it would take to fix this issue, since google
   does not like to parse the Server Error 500 🙂
 * Thank you!
 * regards
    – Alex
 *  [Houke de Kwant](https://wordpress.org/support/users/houkedekwant/)
 * (@houkedekwant)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8840271)
 * We got it to work by replacing
    `add_post_meta( $id, 'custom_permalink', str_replace('%
   2F', '/', urlencode(ltrim(stripcslashes($_REQUEST['custom_permalink']),"/"))));`
   on line 467 with `add_post_meta( $id, 'custom_permalink', trailingslashit(str_replace('%
   2F', '/', urlencode(ltrim(stripcslashes($_REQUEST['custom_permalink']),"/")))));`,
   because we ended up in a redirect loop for some pages. (With this fix we force
   a trailingslash at the end of the url).
 * Not sure if this fixes it for you, but you might give it a try.
 * After editing the file you should resave your pages to update the post meta.
 *  [netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/)
 * (@netzwerkstudio)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8840379)
 * Hi,
 * thank you for your code snippet!
 * I have made the modifications and saved the pages, so that the trailing slash
   would be added properly. Unfortunately it does not change the result in Error
   500.
 * regards
    – Alex
    -  This reply was modified 9 years, 3 months ago by [netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/).
 *  [Houke de Kwant](https://wordpress.org/support/users/houkedekwant/)
 * (@houkedekwant)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8852884)
 * It appeared we still had 500 errors on some pages, so some further research showed
   that the `custom_permalinks_page_link` function returned the wrong permalink 
   if no custom_permalink was set. We’ve WPML setup with ‘Use directory for default
   language’ checked. However, the function returned the url without the language
   code for the default language. So we got stuck in the following loop if we didn’t
   set a custom permalink: [http://siteurl.com/EN/page](http://siteurl.com/EN/page)-
   > [http://siteurl.com/page](http://siteurl.com/page) -> [http://siteurl.com/EN/page](http://siteurl.com/EN/page)-
   > etc… We now force the addition of the custom_permalink post_meta in the `custom_permalinks_save_post`
   function by adding `else{
    add_post_meta( $id, ‘custom_permalink’, trailingslashit(
   str_replace(‘%2F’, ‘/’, urlencode(ltrim(stripcslashes($original_link),”/”)))));}`
   after the if statement. Now we had to resave the pages which died, the post meta
   was set and we got out of the redirect loop.
 *  Plugin Author [Sami Ahmed Siddiqui](https://wordpress.org/support/users/sasiddiqui/)
 * (@sasiddiqui)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8911701)
 * Hey everyone(@mike1707, [@netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/),
   [@houkedekwant](https://wordpress.org/support/users/houkedekwant/))
 * I have fixed the conflict with PolyLang Plugin. Please check the latest version
   and provide me your feedbacks.
 * Regards,
    Sami
 *  [netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/)
 * (@netzwerkstudio)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8911855)
 * Hi,
 * well, i don’t use polylang, but WPML.
    Unfortunately, with version 0.9 the Error
   500 remains. Translations are not working…
 * regards
    – Alex
 *  Plugin Author [Sami Ahmed Siddiqui](https://wordpress.org/support/users/sasiddiqui/)
 * (@sasiddiqui)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8911967)
 * Hi Alex( [@netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/)),
 * Can you provide me the Plugin URL you are using?
 * Regards,
    Sami
 *  [netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/)
 * (@netzwerkstudio)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8911998)
 * Hi,
 * Plugin URL is [https://wpml.org/](https://wpml.org/)
 * regards
    – Alex
 *  Plugin Author [Sami Ahmed Siddiqui](https://wordpress.org/support/users/sasiddiqui/)
 * (@sasiddiqui)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8912116)
 * Hi Alex( [@netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/)),
 * Sorry about the confusion. I have fixed the conflicts with PolyLang. Wpml seems
   to be a paid plugin so, i can’t help you in fixing the conflicts with it.
 * Regards,
    Sami
 *  [netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/)
 * (@netzwerkstudio)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8912544)
 * Hi there,
 * it is a paid version, however there should be WPML guidelines you may find useful.
   
   WPML is probably the most spread Translation Tool for WP and you want to be compatible
   with it, i suppose 🙂
 * Since i have an unlimited dev license of WPML i could set up a testing environment
   for you, if that would help.
 * regards
    – Alex
    -  This reply was modified 9 years, 2 months ago by [netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/).
 *  Plugin Author [Sami Ahmed Siddiqui](https://wordpress.org/support/users/sasiddiqui/)
 * (@sasiddiqui)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8912656)
 * Alex it would be really helpful if you can provide me a testing env.
 * Regards,
    Sami
 *  [netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/)
 * (@netzwerkstudio)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8912849)
 * Hey,
 * i was afraid, you were going to say that 🙂
 * Please email me at ar[at]netzwerkstudio.de, so i can send you the login.
 * regards
    – Alex
 *  Plugin Author [Sami Ahmed Siddiqui](https://wordpress.org/support/users/sasiddiqui/)
 * (@sasiddiqui)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8913524)
 * Hey,
 * I was waiting for the offer and you just did it 😉
 * I have emailed you for further info 🙂
 * Regards,
    Sami
    -  This reply was modified 9 years, 2 months ago by [Sami Ahmed Siddiqui](https://wordpress.org/support/users/sasiddiqui/).
 *  [netzwerkstudio](https://wordpress.org/support/users/netzwerkstudio/)
 * (@netzwerkstudio)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/#post-8938783)
 * Hi,
 * any news on that?
 * I just updated to 0.9.1 and still Error 500 with WPML.
 * Do you still need access to my testing env or can i close it down?
 * regards
    – Alex

Viewing 15 replies - 1 through 15 (of 27 total)

1 [2](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/page/2/?output_format=md)

The topic ‘Custom Permalinks + Wpml Plugin’ is closed to new replies.

 * ![](https://ps.w.org/custom-permalinks/assets/icon.svg?rev=1785367)
 * [Custom Permalinks](https://wordpress.org/plugins/custom-permalinks/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-permalinks/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-permalinks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-permalinks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-permalinks/reviews/)

 * 27 replies
 * 6 participants
 * Last reply from: [okadots](https://wordpress.org/support/users/okadots/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/custom-permalinks-wpml-plugin/page/2/#post-9679088)
 * Status: resolved