[Resolved] Custom post types slug do not translate correctly.
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing issues with the slugs of custom post types not being applied correctly when displaying an archive page in another language. Despite setting the slugs correctly and translating them, the links in the language switcher do not reflect the translated slugs, leading to 404 errors or incorrect pages being displayed. Solution: 1. Verify that the slugs for the translated custom post types (CPTs) are set correctly in WPML. This can be checked under the WPML Translation Editor where the slugs should be translated for all jobs. 2. Check if there is a conflict between the page slugs and CPT slugs. This issue might arise if the same slug is used for different types of content, such as a page and a CPT. This can be identified by using tools like the 'Debug Bar' plugin to analyze the request and query strings. 3. If the problem persists even after ensuring no slug conflicts and correct settings in WPML, it might be due to a theme or plugin conflict. Specifically, the Porto Theme and its related functionality plugin could be causing the issue as they handle the post types. In this case, reaching out to the Porto Support Team for further assistance is recommended.
Please note that the solution provided might be outdated or not applicable to your specific case. 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 the issue persists, please open a new support ticket with us for further assistance.
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.
The slugs of custom postypes have been defined in the settings, nevertheless, they are not applied when trying to display an archive page in an other language.
Examples : hidden link in French is in English hidden link instead of hidden link
Or : hidden link in French is in English hidden link instead of hidden link (and the English version misses a part of the CSS).
(Ticket Re-opend because you closed it without giving me time to answer)
Could you please increase the WordPress memory limit (WP Memory Limit) to at least 256 MB? WPML requires at least 128 MB.
Your current values are:
PHP Memory Limit 512 MB
WP Memory Limit 64 MB
To do this, you need to connect to your website's server and open the wp-config.php file in a text editor. The file is located in the WordPress root directory.
Add this code to the wp-config.php file to increase WordPress's memory:
define ('WP_MEMORY_LIMIT', '256M');
Add this just before this comment:
// That's all, stop editing! Happy blogging.
The current values can be viewed under WPML > Support > WordPress.
These settings can be restricted directly by your hosting provider. Therefore, I recommend contacting them and asking them to change them directly if the changes are not applied automatically.
After adjusting the limit, please go to WPML > Settings > Post Types Translation and edit the fields for your slug translations, then save these settings again.
If this does not solve the issue or you need assistance with adjusting the WP MEMORY LIMIT, please let me know.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
Hello,
I'd be happy to take a closer look at this and request temporary access (wp-admin and FTP) to the website to investigate the issue further.
You'll find the necessary fields below the comment section if you log in to leave the next reply. The information you provide will be private, meaning only you and I will be able to see and access it.
IMPORTANT
Please be sure to create a backup of the website and database before granting us access.
If you don't see the "wp-admin / FTP" fields, your login credentials for the post and website will be set to "PUBLIC." Do NOT publish the information unless you see the required wp-admin / FTP fields.
I may need to install a plugin called "All In One WP Migration" to create a copy of the website on which I can investigate the problem more thoroughly.
I would also be very grateful if you could provide a staging site on your server for this purpose.
If you have any questions about creating such a staging site, please contact your hosting provider. Please ensure that WPML is also registered on this staging site at https://wpml.org/de/account/websites/.
If you are unable to provide such a copy of the website for testing, please let me know on this ticket.
The private reply form looks like this: hidden link
When replying again, click "I still need assistance".
Video: hidden link
Please note that we are required to request this information individually on each ticket. We are not permitted to access any login information that was not specifically provided in the private reply form for this ticket.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
Your translated CPTs are using the correct slugs: hidden link
The issue is about the slug of the page "L'equipe", and the page slugs are set to "Translate" inside WPML. Inside the WPML Translation Editor, the slugs are translated on all jobs for this page.
If you revise the example, the English page "The Team" on the WordPress Editor, you can see that WPML translated the permalink correctly, and the page is accessible hidden link
The odd thing is, we seem to reach a different page, with a different layout.
It seems like you are trying to use the same slug "equipe" in different ways, like once for a page and then again for a CPT for "member" and this creates a conflict:
I'm speaking of the archive page of the CPT.
So I changed the slug of the page to "notre-equipe" and I took care of translating it in all languages.
Nevertheless, when we go to hidden link you see that the links in the language switcher are all with "notre-equipe".
And hidden link is now a 404
hidden link exists and is accessible, but is not the link in the lanquage switcher in French. But if you look at the links in the language switcher on this english page, they are correct.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
I am sorry to hear that my suggested workaround did not solve this issue. To investigate this issue further, I am going to take a local copy of the site.
Once I have finished the tests, I will reach out again.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
Still, the problem is that hidden link is recognized as CPT archive and not as a page.
This problem is visible even if you disable WPML.
1) Activate the plugin "Debug Bar"
2) Go to hidden link and check the admin bar for "Debug" on the top right and click on request.
You will see:
notre-equipe
Query String:
post_type=member
The issue is not the translation, as the conflict already exists in the original content.
You can see the same issue even when testing the site only with the Porto Theme and the Porto Theme - Functionality plugin.
If you revise the member post type in Porto, I can confirm that the slug for this post type and the slug of your team page are not identical. Anyhow, WordPress is not recognizing the page as such.
This is why I suggest you consult the Porto Support Team about this issue.