This thread is resolved. Here is a description of the problem and solution.
Problem:
When using custom permalink structure with custom code for a CPT UI post type the translated posts are not loading.
Solution:
WPML supports only custom slug translation and not custom permalink structure.
When you use CPT UI plugin for a custom permalink structure you can use Permalink Manager plugin as suggested in the plugin document linked next.
Relevant Documentation:
https://wpml.org/documentation/support/translating-slugs-for-custom-post-type-archives/
https://docs.pluginize.com/article/customizing-permalinks/
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.
Tagged: Documentation request
This topic contains 16 replies, has 2 voices.
Last updated by Subash Chandra Poudel 1 year, 3 months ago.
Assisted by: Subash Chandra Poudel.
Author | Posts |
---|---|
July 7, 2023 at 8:36 am #13966049 | |
rutgerd-3 |
Categories and articles are not always shown live after translating. What are correct setting for this? Please help with instructions. We have translated some articles in French, German and English. But not all are shown live in the language when selecting the language on the site. Links are shown in the categories, but when clicking the link it automayically directs to Dutch home. (Original language is Dutch) Example: hidden link Domain: Please help with settings to get this right. Translated articles should only thow in their language version of the website. Now we also see links to articles in the Dutch version of the website. Hope to hear from you soon. Enclosed a screenshot of categorie overview in Dutch website containing English atricles. Best regards, Floris |
July 8, 2023 at 11:19 am #13971241 | |
Subash Chandra Poudel |
Hi Floris, I see the issue on the site at hidden link Can you please try the following and see if it helps: - Backup the site completely to prevent any issues and for a reference point. - Make sure all required articles are translated in all required languages. - Also make sure all related categories/taxonomies are translated from WPML -> Taxonomy Translation - Now WordPress Dashboard -> WPML -> Support page, Click on the "Troubleshooting" link there - Select the post type for the articles and click on the "Synchronize posts taxonomies" button there. - Also Click on the Clear and Fix options there like the following options except for the Reset options. Those options will fix any translation and Database issues if there are any. Clear the Cache in WPML - Now finally go to WPML -> Setting page, scroll to "Translate Link Targets" and click on "Scan now and adjust links" button then allow it to run completely. In case this does not solves the issue, I might need to take a closer look at your site. Will it be possible for you share the site access ( wp-admin and FTP ) possibly to a test/staging site where the issue is replicated where we can troubleshoot the issue further. Regards, |
July 10, 2023 at 12:43 pm #13999295 | |
rutgerd-3 |
Hi Subash, Thank tou for your advise, but I have to inform that did not work. I followed all steps you wrote down, but the result remains the same. This post is live, but redirects strait to home: hidden link Also in categories a variety of languages and articles are listed when it shouldn't. Per example: hidden link This is the English translated version of category: Chatbots The category lists articles in English, German and Dutch. See screenshot. Yellow is English, Red is German, all others are Dutch.It should only list English posts. Also our job listing have gone wrong. The job description fot Chat Operator is listed 4 times in at the Dutch page. Dutch, English, German and French, Summaries are missing. All other languages have no accessible translated page for job listings, the vacancie for chat operator is translated, and should only be available on a translated page of the language. Please have a look yourself. I will create a login for you. Best regards, FLoris |
July 10, 2023 at 12:47 pm #13999595 | |
rutgerd-3 |
Also, I have made a backup before executing the list you sent. I will nowe restore that backup. |
July 10, 2023 at 6:07 pm #14008939 | |
Subash Chandra Poudel |
Hi there, Thank you for the updates. To troubleshoot the issue further I would need to take a closer look at your site. So would you please mind sharing temporary access (WP-Admin and FTP) to your site? Preferably to a test site where the problem has been replicated. I have enabled a private reply for you to share the credentials securely, which means only you and I have access to it. IMPORTANT: Please take a complete backup of the site first to avoid data loss. ✙ I would additionally need your permission to make a copy of the site with plugins like Duplicator and deploy it in my local machine to test the issue further. Regards, |
July 13, 2023 at 6:02 pm #14035561 | |
Subash Chandra Poudel |
Hi there, I tried to make a copy of your site using Duplicator and All In One Migration plugins but it does not seem to work. Will it be possible for you to use Duplicator plugin to create a site package as explained in the next link then provide a site copy to me? https://wpml.org/faq/provide-supporters-copy-site/ Or if it does not works please create backup of all files and database of the site and share the download link here after uploading the files to a filesharing app like Google Drive or DropBox. I have enabled a private reply for you to share the details securely. Regards, |
July 14, 2023 at 12:39 pm #14039735 | |
rutgerd-3 |
Hi Subash, I have tried to make the copy for you, but It did not work. The reason is simple. The duplicator plugin only supports site files packages up to 500MB, our site is wel over 1000MB. So it stops halfway. I have another suggestion for you. I can grant u access to our server hosting. On the server we use a staging website to try fixes and other big changes before we put them live. You can work in the staging website, do all your research and fixes to check if it all works. Just not put them live before we are sure all issues are resolved correctly. First make a backup from the staging website, that way you can test and change all you want, and always put it back when it does not work. I allready have a backup from the site since before I asked your help. So no worries, we have our basics covert. Hope this works for you. Please let me know if we can proceed this way. Best regards, Floris |
July 14, 2023 at 3:41 pm #14040715 | |
Subash Chandra Poudel |
Hi Floris, Sure, please setup the staging site and share the staging access details ( wp-admin and FTP ) complete server access might not be required though! You can only send wp-admin and FTP access for the staging site where we are free to activate/deactivate settings or plugins, themes to test. I have enabled the private reply for you to share the details again securely. Regards, |
July 18, 2023 at 2:15 pm #14060037 | |
Subash Chandra Poudel |
Hi Floris, Thank you for the details. I now see how the CPT and custom Slug is setup. I see you are using "post_type_link" to modify the Permalink of Posts with a custom code. Please note that WPML supports only custom slug translation (when the custom type is registered) but not custom permalink structure ass explained in the following document: https://wpml.org/documentation/support/translating-slugs-for-custom-post-type-archives/ From the CPT UI documentation I see they suggests using Permalink Manager plugin to use custom permalinks as explained in the next document: hidden link Can you please use the CPT UI suggested method instead and see if it helps? Also, please contact the CPT UI provider and see if they have any suggestions or can help in this case. Regards, |
July 24, 2023 at 9:20 am #14087611 | |
rutgerd-3 |
Hi, I found the specific code for this. Personally, I don't know why it was there. Possibly only if there were uncrated items. I have removed the code. We only have some rewrite rules via CPT UI. Other than that we don't need customization. Then it should all work now, right? I applied it to the staging website |
July 24, 2023 at 4:06 pm #14091399 | |
Subash Chandra Poudel |
Hi there, Thank you for the updates. Yes, if you removed the custom code for the custom permalink structure and set the CPT slug normally in the CPT Options the default CPT slugs and their translation should work fine with WPML.. I see your staging site sill has the issue and is an exact copy of the main site. It should work fine WPML after you: - Remove the custom Permalink Structure custom code from theme file functions.php Regards, |
July 25, 2023 at 2:05 pm #14097115 | |
rutgerd-3 |
Could you recheck? |
July 25, 2023 at 5:07 pm #14098453 | |
Subash Chandra Poudel |
Hi there, I rechecked your staging site hidden link again However I still the exact same setup as your main site there. I see you still have the custom code for custom permalinks in your theme file functions.php as shown in the attached screenshot. I also see you still use WPML and CPT UI unsupported custom Slug at CPT UI -> Add/Edit Post Types -> Edit Post Types -> Kenniscentrum -> Custom Rewrite Slug. Please follow my previous reply linked next and it should fix the issue. If you need to use custom permalink I recommend you to contact CPT UI and consult with them the best way to achieve the custom permalink. Regards, |
July 28, 2023 at 1:23 pm #14117613 | |
rutgerd-3 |
So, the problem I am facing is that it seems rather hard to get a nice copy of my live website including WPML translated texts on staging. That is why I had to set back a back-up. Let me try another way. |
July 30, 2023 at 3:42 am #14122083 | |
Subash Chandra Poudel |
Hi there, Thank you for the updates. Sure, once you setup a test site you can test the solution I advised on my previous reply linked next And also apply it on live site if all is okay. Regards, |