This thread is resolved. Here is a description of the problem and solution.
Problem:
The client needs to modify the language URL format to include country codes like /ca/fr/ and /us/en/ in their WordPress site using WPML. They attempted to modify the
REQUEST_URI
in an init hook but were unable to change the permalink structure as desired.
Solution:
We informed the client that achieving this URL format with WPML directly is not possible without additional custom coding. Since this requires complex code and might cause side effects, we recommended hiring a WPML contractor for professional assistance. You can find a suitable contractor by visiting https://wpml.org/contractors/.
Please note that this solution might be outdated or not applicable to your specific case. If this does not resolve your issue, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket at WPML support forum.
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.