Title: Polylang Compatibility: Permalink Issue
Last modified: October 6, 2016

---

# Polylang Compatibility: Permalink Issue

 *  [clockwork.gr](https://wordpress.org/support/users/clockworkgr/)
 * (@clockworkgr)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/polylang-compatibility-permalink-issue/)
 * Hello,
 * I am having trouble getting the plugin to work properly with polylang.
 * Basically permalinks (no matter how many times I regenerate them) are not working
   properly for the view/ and share endpoints.
 * It works if I set polylang URL modifications to “Language is set from content”,
 * so the wishlist page is /my-wishlist/ and /my-wishlist/view/ /my-wishlist/view/{
   share-id} all work fine.
 * But using that setting means I can’t have translations for the UI elements of
   Woocommerce using ”
    Hyyan WooCommerce Polylang Integration” plugin since as 
   its readme mentions: “Polylang URL modifications method The language is set from
   content is not supported yet”.
 * If I switch to “The language is set from the directory name in pretty permalinks”
   in polylang, woocommerce translations work fine but /{lang}/my-wishlist/view//{
   lang}/my-wishlist/view/{share-id} now return 404 errors.
 * Any ideas? Even if I have to hardcode the relevant rewrite rules.
 * Alex

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [clockwork.gr](https://wordpress.org/support/users/clockworkgr/)
 * (@clockworkgr)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/polylang-compatibility-permalink-issue/#post-8258723)
 * In case anyone runs into this issue:
 * Fixed it by hardcoding the relevant permalinks.
 * Auto generated ones are:
 *     ```
       [(([^/]+/)*{wishlist-page-slug})(/(.*))?/page/([0-9]{1,})/?$] => index.php?pagename=$matches[1]&wishlist-action=$matches[4]&paged=$matches[5]
       [(([^/]+/)*{wishlist-page-slug})(/(.*))?/?$] => index.php?pagename=$matches[1]&wishlist-action=$matches[4]
       ```
   
 * Just add your language ones with the lang prefix in functions.php as follows:
 *     ```
       function YITH_polylang_rewrite_rules() {
           //Lang 1
           add_rewrite_rule('{lang1-slug}/(([^/]+/)*{wishlist-page-lang1-slug})(/(.*))?/page/([0-9]{1,})/?$','index.php?pagename=$matches[1]&wishlist-action=$matches[4]&paged=$matches[5]');
           add_rewrite_rule('{lang1-slug}/(([^/]+/)*{wishlist-page-lang1-slug})(/(.*))?/?$','index.php?pagename=$matches[1]&wishlist-action=$matches[4]','top');
           //Lang 2
           add_rewrite_rule('{lang2-slug}/(([^/]+/)*{wishlist-page-lang2-slug})(/(.*))?/page/([0-9]{1,})/?$','index.php?pagename=$matches[1]&wishlist-action=$matches[4]&paged=$matches[5]');
           add_rewrite_rule('{lang2-slug}/(([^/]+/)*{wishlist-page-lang2-slug})(/(.*))?/?$','index.php?pagename=$matches[1]&wishlist-action=$matches[4]','top');
           // .... and so on
         }
         add_action('init', 'YITH_polylang_rewrite_rules', 10, 0);
       ```
   
 * Alex
 *  [ARuWeb](https://wordpress.org/support/users/aruweb/)
 * (@aruweb)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/polylang-compatibility-permalink-issue/#post-8265823)
 * Thank you Dude,
 * Your hack also solved my issue!
 * Have a nice day!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Polylang Compatibility: Permalink Issue’ is closed to new replies.

 * ![](https://ps.w.org/yith-woocommerce-wishlist/assets/icon-128x128.gif?rev=3129302)
 * [YITH WooCommerce Wishlist](https://wordpress.org/plugins/yith-woocommerce-wishlist/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yith-woocommerce-wishlist/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yith-woocommerce-wishlist/)
 * [Active Topics](https://wordpress.org/support/plugin/yith-woocommerce-wishlist/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yith-woocommerce-wishlist/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yith-woocommerce-wishlist/reviews/)

## Tags

 * [yith-wishlist](https://wordpress.org/support/topic-tag/yith-wishlist/)

 * 2 replies
 * 2 participants
 * Last reply from: [ARuWeb](https://wordpress.org/support/users/aruweb/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/polylang-compatibility-permalink-issue/#post-8265823)
 * Status: not resolved