This thread is resolved. Here is a description of the problem and solution.
Problem: The client was experiencing an 'Invalid Post Type' error when trying to translate posts in a custom post type called Reviews. Upon switching the language to English, the error appeared, despite the post type configuration seeming correct. Solution: We resolved the issue by modifying the translation settings for the custom post type. In the WPML -> Settings -> Post Types Translation section, we changed the 'Post Type' (acf-post-type) from Translatable to Not translatable. This adjustment allowed the client to switch and edit a Review post in English without encountering the 'Invalid Post Type' error.
If this solution does not resolve your issue, or if it seems outdated, we recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should the problem persist, please open a new support ticket.
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.
Background of the issue:
I am trying to translate posts in a post type called Reviews. When I switch the language to English, it shows 'Invalid Post Type'. The configuration of the post type seems correct and is similar to another post type called Press. I need help analyzing the problem. Link to a page where the issue can be seen: hidden link
Symptoms:
When I change the language to duplicate and add the content I have translated, I got 'Invalid Post Type'.
Questions:
Why does switching the language to English show 'Invalid Post Type'?
How can I resolve the 'Invalid Post Type' error when translating posts in the Reviews post type?
2. Go to WPML -> Support -> Troubleshooting (link)
3. Once on the troubleshooting screen, press the following buttons and check if it helps. Press each button at a time and wait for the process to complete.
- 'Disable cache for language switcher templates'
- 'Clear language information and repopulate languages' button (if it is showing)
- 'Synchronize posts taxonomies' for 'Reviews'
- 'Clear the cache in WPML'
- 'Remove ghost entries from the translation tables'
- 'Fix element_type collation'
- 'Fix WPML tables collation'
- 'Synchronize local job ids with ATE jobs'
- 'Synchronize translators and translation managers with ATE'
- 'Assign translation status to duplicated content'
- 'Set language information'
- 'Reset languages' Press this button only if you didn't add a custom language!
- 'Fix terms count'
- 'Fix post type assignment for translations'
- 'Cleanup and optimize string tables'
- 'Clear invalid strings'
*** Please make a backup of your database before using this.***
Not all the troubleshooting options may be necessary, but please try them all once you are on the troubleshooting page.
It is recommended to try the following on a staging site and not on the live site.
We suspect a collision with the theme or another plugin might cause this problem. If possible, get your site into a minimum environment, switching to a default WordPress theme like TwentyTwenty-Four and having no plugins activated except WPML and ACF.
First, you must check if the problem persists when just the theme is switched to TwentyTwenty-Four (for example). If it persists, deactivate all plugins except WPML and its add-ons and ACF without any extensions, if you have any. Then, please check if the problem persists. If it does not continue, start by activating the plugins individually and checking when the issue comes back, then report to me which plugin was the culprit.
**** Important! Please make a full site backup (files and DB) before you proceed with those steps****
*** If your site is live, you might want to try those procedures in a staging environment or a snapshot of your site on your local server or another server. ***
Hello,
I tried all of the things above. I cloned the site under a new demo domain inside one of our servers and changed theme, and then disabled plugins but it didn't work. I need further assistance with this cuz it needs to be fixed ASAP.
Can you please let us access your staging site so we can check things there? If our second-tier supporters need to debug this issue further and esclate it to our second-tier supporter, please allow me to take a copy of your site. For this, I must install a plugin like Duplicator or All In One Migration. Please let me know if you agree.
If you need further help with this, please share the access details to your site with me. I'm enabling a private message for the following reply. Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ **IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--
I could solve this issue on the staging site. Here is what I did.
In WPML -> Settings -> Post Types Translation, I switched 'Post Type' (acf-post-type) from Translatable to Not translatable. Please see the attached screenshot. Now it is possible to switch to edit a Review post in English.
Can you please confirm that this has solved the problem?