This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Author Posts
May 31, 2019 at 4:55 pm #3932239

subinK

I am trying to:Get the Arabic url correctly

Link to a page where the issue can be seen:hidden link (category and sub-category pages)

I expected to see:The above link as hidden link (Without '-ar' in the category and sub category slugs) Note : All categories and the sub categories are having the same issue, which need to be fixed asap.

Instead, I got: URLs with '-ar' which shouldn't happen for this site's entire urls

May 31, 2019 at 7:34 pm #3932773

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

is Arabic set as the default language of your site or the translation language ?

You can go to WPML->Languages-> let me know which language is set as default , also which language did you set as primary when configuring your WPML setup

I see that your English URL is set to hidden link therefore you cannot have the slugs be the same in both languages as that would create issues.

you can translate your slugs for Arabic for example so they are different , but that is why -ar is included at the end so they are not the same

June 3, 2019 at 10:02 am #3941139

subinK

Hi, Please note we have set English as the default / primary language, not Arabic. is there any way we can remove -ar from the Arabic url? please let us know. if you need any more information to solve this issue asap, please let me know. Basically '/ar' -sub folder in the URL is ok, but slug '-ar' should not be there in the url for sure. please look into this , URGENT !

June 3, 2019 at 5:22 pm #3944889

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

Please note that you cannot have the same url slug in two or more languages.

example :

EN URL hidden link

you cannot have the same slug '/supporting-the-breastfeeding-mom/ ' in the AR URL , therefore that is why -ar is added as i mentioned above as EN is the default language.

you can instead translate the url slug if you wish to remove '-ar' but it cant be the same.

to do this follow the steps bellow

Category taxonony slugs

1 - In your WordPress Dashboard > Posts > Categories, click to edit the category you need to change the slug.

2 - Change to the language you need to edit the slug and replace the current category slug with your own.

Post and page slugs

1 - In your WordPress Dashboard > Pages/Posts, click to edit the page/post need to change the slug.

2 - Edit the page/post slug to match your own choice.

Note: you would need to resave your permalinks in your WordPress Dashboard > Settings > Permalinks, to make sure the changes are reflected in the website frontend.

A more detailed explanation of why this is happening :

You cant have the same slug in WordPress. If you try to create two taxonomy terms for example with the same slug in the same language WordPress will automatically add a numbered suffix at the end of them to make them unique.

Therefore WPML has been following that practice too. So while WordPress will add a number, WPML adds the language code to the slug.(-ar in your case)

With the actual versions you can't change to the same slugs from the WPML interface:

If you change a category slug from the WPML user interface, it will get a number (by WordPress) if you change it from the quick edit in WPML >Taxonomy translation it will get the language tag added.

This is a WordPress behavior.

June 4, 2019 at 4:55 am #3947953

subinK

So basically, if we need to change the slug it needs to be translated to Arabic? putting Arabic word in a url is not a good way, also this issue was not there in the previous versions of the WPML. We have used WPML in our previous projects as well, but now once we bought the premium version this issue came out. we really don't want to add Arabic word to the url, please suggest any other solution asap, as we need to sort this out and go live with this project.

June 4, 2019 at 5:15 pm #3953999

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

If you do not wish to use an arabic string then you can use any string , English as well but it cannot be the same slug as the default language.

the slug needs to be different this is not a WPML limitation but a WordPress one as i have explained above therefore the following can be used as an example

EN slug : supporting-the-breastfeeding-mom/

AR slug : breastfeeding-mom-support/

these two are different slugs , therefore no -ar added automatically.

NOTE : You can try the following if you wish but i cannot guarrante that it will work OK or what the expected results will be as this is a WordPress limitation

1. Go to your categories
2. Go to the Arabic categories
3. Quick edit
4. Remove -ar from slug and save.

5. Test and see if this is working ok for your site , if not please follow my previous instructions

The topic ‘[Closed] We are facing issue in the Arabic url of the site’ is closed to new replies.