Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-08:00)

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by Bobby 3 months ago.

Assisted by: Bobby.

Author Posts
September 11, 2024 at 9:09 am #16165303

paulW-64

Background of the issue:
We have a website that we are setting up for use with WPML and it uses the Custom Permalinks plugin for mapping the permalink for the categories.
I have the following versions installed: WPML: v4.6.12, Custom Permalinks: v2.7.0.
These were added when creating the categories initially and show as per the below DEFAULT LANGUAGE.
DEFAULT LANGUAGE - WORKS (English)
/industry-sectors/
/industry-sectors/infrastructure/
When viewing the 'Taxonomies Permalinks' for the Custom Permalinks plugins, these are the values shown
CUSTOM PERMALINKS - DOESN'T WORK
/en/industry-sectors/
/en/industry-sectors/infrastructure/
CURRENT SETUP FOR TRANSLATED LINKS - WORKS
/fr/secteurs-dactivite/
CURRENT SETUP FOR TRANSLATED LINKS - DOESN'T WORK
/fr/secteurs-dactivite/infrastructure-fr/
When using the Language selector in the menu and switching from the default language to French, this is the URL which appears is shown when I hover the cursor over the French flag.
DEFAULT - /industry-sectors/infrastructure/
SWITCH URL - /fr/category/secteurs-dactivite/infrastructure-fr/
While the switch URL above does show the data, but the permalink doesn't work as expected.
I investigated and the certified plugin states that it should work as expected, and I would hate to have to manually add each taxonomy permalink.

Symptoms:
The permalink for translated taxonomies/categories does not work as expected when using the Custom Permalinks plugin with WPML.

Questions:
Why doesn't the permalink for translated taxonomies/categories work as expected?
Is there a way to automatically map the permalinks for translated taxonomies/categories without manually adding each one?

September 11, 2024 at 6:39 pm #16167850

Bobby
Supporter

Languages: English (English )

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

Hi there,

Please review the following Errata of a known issue between this plugin and WPML.

https://wpml.org/errata/custom-permalinks-redirection-issue-with-trailing-slash/

There is a workaround listed, try it and let me know your results.

September 12, 2024 at 1:12 am #16168449

paulW-64

Unfortunately, this was no help.

I'm sent to a 404 page rather than retrieving the translated page using the custom permalinks plugin.

As shown by the uploaded image "wpml-cp-industry-sectors-tourism-fr-default-cp.png"

I reviewed this article to see if it would help - https://wpml.org/faq/how-can-i-reconnect-taxonomy-translations-to-their-default-language-terms/

The taxonomy/category for the translated French was connected to the default language as expected.

For the default languages these two (2) categories (Industry Sectors & Infrastructure) they have Custom Permalinks set as /industry-sectors/ & /industry-sectors/infrastructure/
As shown in the uploaded images
"wpml-cp-industry-sectors-en.png"
"wpml-cp-industry-sectors-infrastructure-en"

For the translated categories which should be served at these slugs/permalinks
/fr/secteurs-dactivite/ & /fr/secteurs-dactivite/infrastructure-fr/

When I viewed the translated categories
As shown in the uploaded images
"wpml-cp-industry-sectors-fr.png"
This works using the default setup

However, this didn't, so I manually adjusted the permalink for this as a test
"wpml-cp-industry-sectors-infrastructure-fr.png"
Which worked as shown in this image
"wpml-cp-industry-sectors-infrastructure-fr-manual-added-cp.png"

As previously mentioned, I'm trying to avoid having to update/add a custom permalink for each language.

I'm not sure if this is a potential indicator with an issue in WPML, but if you look at the uploaded image "wpml-cp-investment-type-energy-en-menu-default-cp.png"
You will see how when attempting to switch from a category page in the default English to French, that the URL link as shown in the bottom left corner shows the default WordPress URL format which includes the word "category" (categorie - French)

I hope that you can shed some light on this.

wpml-cp-investment-type-energy-en-menu-default-cp.png
wpml-cp-industry-sectors-en.png
wpml-cp-industry-sectors-fr.png
wpml-cp-industry-sectors-infrastructure-en.png
wpml-cp-industry-sectors-infrastructure-fr.png
wpml-cp-industry-sectors-infrastructure-fr-manual-added-cp.png
September 13, 2024 at 3:59 am #16173847

Bobby
Supporter

Languages: English (English )

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

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

September 16, 2024 at 12:17 am #16181038

paulW-64

I will get this setup and let you know when code has been deployed to an environment that is accessible.

September 16, 2024 at 5:14 pm #16185090

Bobby
Supporter

Languages: English (English )

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

Thank you.

Note: If you get an email reminding you to reply to us and the environment is not ready yet, please just send a quick update to make sure the thread remains open due to our automatic system.

September 18, 2024 at 10:46 pm #16195547

Bobby
Supporter

Languages: English (English )

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

If you edit the categories that you shared you will notice that the ID language includes the kategorie in the custom permalink field.

See here:

hidden link

Removing manually resolves the issue, which is what I believe you have been doing so far from my understanding.

If you create a new category and translate it, are you able to reproduce this behavior?

Unfortunately I do not believe that there is a way to remove /kategori/ in bulk, at least not from WPML. You could tinker with a find-and-replace plugin for example and see if that would work.

September 19, 2024 at 12:13 am #16195621

paulW-64

I have created a new category and assigned a custom permalink.
Then I translated it as requested.
This however after the translation and sync of hierarchy, it didn't provide the correct custom permalink with the word category removed.

I will just handle manually updating the categories as I add a new translation.

I did have another issue where I was expecting that I would have a different Sitemap for each language as per the below URLs
hidden link
hidden link

However, the Indonesian version shown above doesn't work. Upon looking at the "Page Sitemap" from the existing/default language - hidden link
I can see that it has the translated version for the home page listed there.

I wanted to verify that this is the correct behavior?

September 19, 2024 at 10:32 pm #16200900

Bobby
Supporter

Languages: English (English )

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

Hi there,

Yes, that is the expected behavior. The only time you will have a separate URL for the sitemap is if your site is using a different domain per language.

September 20, 2024 at 12:27 am #16200976

paulW-64

One last item, within Custom Permalinks after the initial Taxonomy translations, the default language has the following permalinks listed within the Custom Permalinks plugins

/en/industry-sectors/
/en/investment-types/

However, the links don't work and revert to what is set within the category settings of
/industry-sectors/
/investment-types/

I wanted to know if you are aware of this issue?

September 20, 2024 at 5:54 pm #16203923

Bobby
Supporter

Languages: English (English )

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

I can see what you mean by reviewing it, however, the site is not set up to use the directory in the default language. You can confirm or adjust that within WPML->Languages, therefore it is expected that the /en/ will be stripped.

Did the site use directories before at some point for the default language?

The topic ‘[Closed] Custom Permalinks not for taxonomies/categories’ is closed to new replies.