Learn how to set up a bilingual WordPress site using Polylang. Solve issues like menu switching, mobile menu logic, and Arabic slug changes.
Creating a bilingual website in WordPress can be seamless with the help of the Polylang plugin. However, while setting it up for a client project with English and Arabic, we encountered a few critical challenges. In this blog, I’ll walk you through the setup process, the real issues we faced, and how we solved them effectively.
en, ar) and text direction (Arabic is RTL)Problem:
When switching to Arabic, the menu still showed English links.
Root Cause:
Only one global menu was assigned to the theme’s header.
Solution:
We created separate menus for each language:
→ Header menu English for English
→ Header menu Arabic for Arabic
Then, we mapped them in:
Appearance → Menus → Manage Locations
→ Assign each menu to the correct language location.
Problem:
The mobile menu was not switching as per the selected language — it always showed the English version.
Our Case:
We had 4 menus:
→ Header menu English (Desktop)
→ Header menu Arabic (Desktop)
→ Mobile header English
→ Mobile header Arabic
Root Cause:
The theme’s functions.php didn’t support conditional logic for language-specific mobile menus.
Solution:
We added language-based logic in functions.php:
NOTE: Replace 10734 and 18465 with your actual header post IDs (can be found in the URL when editing the headers).
Problem:
Each time we updated an Arabic page, the slug auto-updated to a long encoded Arabic string.
Solution:
→ WordPress sometimes regenerates slugs automatically when the title is in Arabic.
→ To fix it permanently:
1. Go to Pages > All Pages
2. Hover over the page > Click Quick Edit
3. Manually set a clean slug (e.g., home-arabic)
4. Click Update
This method keeps your slug intact even if the page title is changed later.
While Polylang is powerful for multilingual setups, some themes need fine-tuning, especially for language-specific headers and menus. By:
→ Creating separate menus
→ Writing custom logic in functions.php
→ Using Quick Edit for slugs
...we were able to deliver a smooth bilingual experience with perfect language-based switching, even on mobile.
Let us know your experience or drop your questions below!
(1) (0)
No comments