Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is experiencing issues with 'Invalid post type' and 'Invalid taxonomy' errors after attempting to translate custom post types and taxonomies using the 'Post Types Unlimited' plugin, which is not listed in WPML's compatible plugin directory.
Solution:
1. Navigate to WPML > Settings > Post Type Translation.
2. Set the translation preference for the post types 'ptu' and 'ptu_tax' to 'Not Translatable'.
3. Go to the 'Post Types Unlimited' plugin, delete any translations of custom post types and taxonomies.
4. Clear your site's caches and check if the post types are now accessible.
If the issue persists, we recommend replicating the problem in our sandbox environment to isolate the issue. You can access the sandbox here: WPML Sandbox Environment.

If these steps do not resolve the issue or if it seems outdated or irrelevant to your case, please open a new support ticket. We also 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. For further assistance, you can contact us directly through the 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.

This topic contains 10 replies, has 2 voices.

Last updated by aristotelisS-3 3 months, 2 weeks ago.

Assisted by: Prosenjit Barman.

Author Posts
June 6, 2024 at 8:14 am #15709632

aristotelisS-3

Background of the issue:
Hello, although I have followed the documentation on translating custom post types and taxonomies, something seems to be missing and I get the error of invalid post type or invalid taxonomy.

Symptoms:
Invalid post type and invalid taxonomy error

Questions:
What could be causing the 'Invalid post type' error?
What could be causing the 'Invalid taxonomy' error?
Are there additional steps for translating custom post types and taxonomies that are not covered in the documentation?

June 6, 2024 at 11:30 am #15710822

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

I understand the issue you're encountering. The errors related to 'Invalid post type' and 'Invalid taxonomy' usually point to problems with the registration or configuration of these elements in WordPress.

From the WPML debug information, I noticed several CPT and taxonomies on your site. Please ensure that the slugs for these CPTs are unique. Each CPT must have a distinct slug, and if you have translated the CPT's slug, the translated version must also be unique.

From the WPML debug info, I noticed that the "Post Type Unlimited" plugin is installed, and it seems you used this plugin to create the custom post types. It appears that the post type information stored by this plugin is set to be translatable. If you've translated the custom post type through this plugin, that might be causing the issue.

Please try the following steps to resolve the issue:

1. Go to "WPML > Settings > Post Type Translation."
2. Find the post type named 'ptu' and "ptu_tax" and set their translation preference to 'Not Translatable.'
3. Once done, go to "Post Type Unlimited," and if you have translated any custom post type, delete the translation. You also need to delete the translation of the taxonomies that you have created from Post Type Unlimited plugin.
4. Once done, clear the caches and check if you can now access the post type.

Let me know how it goes. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

June 6, 2024 at 12:32 pm #15710968

aristotelisS-3

First of all thank you for your immediate and enlightening support. I have proceeded up to step 2 (I found those "ptu" types and set them to 'Not Translatable.' However, how do I delete the translations only (I tried deleting the post types when I was in the English backend and I realised that all posts from both languages were sent to trash. Then I recovered them. But when I am on the "Greek" back-end (I see the Greek flag on the top admin bar), and I try visiting an item, it opens with the English flag on the top admin bar. In order to see the difference between the items (with the same names) I tried changing the names and values of a post type in Greek (Keynote Speakers). But now I see nothing in the list of the spedicic post type (. Chaned it back to english. Still nothing. So now I have this even more urgent issue.

June 6, 2024 at 12:58 pm #15711144

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi,
Thank you for the update.

Sorry to hear that you encountered issues after deleting the post types. Please restore a working backup to keep your site functional.

For your information, the "Post Types Unlimited" plugin is not listed in the compatible plugin directory (you can verify this here)of WPML. So, This could be a compatibility issue.

Could you please try to replicate the same issue in our sandbox environment? The autologin URL to our Sandbox is given below.

- hidden link

The WPML and its addons are already installed in the Sandbox. Please complete the setup of WPML. Once done, install the "Post Types Unlimited" plugin. Configure WPML and the Post Type Unlimited plugin just like on your main site, create a post type and check if you can recreate the issue in the Sandbox environment.

If you're able to replicate it on the sandbox, please let me know. I will take a look and try my best to solve the issue for you.

The Sandbox environment helps to test issues in a minimal environment so that we can easily trace the root cause of the issues.

Looking forward to your response and I'm always here to help.

Best regards,
Prosenjit

June 7, 2024 at 6:48 am #15713853

aristotelisS-3

Hello!

I managed to proceed as follows:
1. I created a custom post type with my name in both English and Greek. It worked fine. It doesn't seem to be a matter of plugin conflict. Perhaps it has to do with the order of the steps I took to translate items. So this is still pending as an issue, I will explore it further as soon as I solve the next issue, which is more urgent.

2. Then I tried changing the name of the custom post type, and the post (with my name) disappeared from the list of posts, even if I changed it back to the original slug. HOWEVER this is still in the database, just like my posts with speakers on busart.org: in the front-end I see them perfectly. Only in the back-end they are absent.

Perhaps it has to do with the slugs and some disconnection/disassociation in the database?

June 7, 2024 at 8:07 am #15714045

aristotelisS-3

Here is a short update about the disappeared posts. It seems I was renaming the slug back to a misspelled slug. In the original slug I was using an underscore.

So the main issue has to do with slugs and permalinks. At some points I get "internal server errors" when trying to visit a page. This gets solved if I change the permalinks and save them again (No matter what option I choose).

June 7, 2024 at 8:57 am #15714329

aristotelisS-3

I observed that the permalinks choice is crucial. I have selected "Day and Name" (option 2) and it seems to be working. Is that what it should be?

Let me do my tests and examine if everything works ok and I will confirm shortly. Thank you once again for your time and patience. Just allow me some time to confirm that everything works and I will come back to mark my issue as resolved.

June 7, 2024 at 9:58 am #15714655

aristotelisS-3

Everything seems to be working fine. Thank you so much for your time!

June 7, 2024 at 10:59 am #15715144

aristotelisS-3

I am coming back for another "persistent" problem (in quotation marks because now it is gone and now it is back again!): I get the "Internal Server Error" whatever page I visit on the front end. When I switch the permanent link options, it starts working again. But after some time the "Internal Server Error" appears again.

June 8, 2024 at 8:01 am #15718091

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for the updates.

The 'Internal Server Error' on the frontend typically occurs when a process on your site exceeds the server's resource limits. The root cause is usually recorded in the server error log. Could you please check the server error log to identify any potential issues? You can also share the log with us so that we can check further. If you don't have access to the server error log, please contact your hosting/server administrator to investigate the cause of the persistent server error.

Additionally, could you confirm if you're still experiencing the 'Invalid post type' issue? If so, let's discuss and address that in this ticket. To keep the thread clear and organized, please create a separate ticket for the other issue you mentioned in your last message, providing the requested details. Me or one of our support team members will take the ticket and assist you with that issue accordingly.

Looking forward to your response.

Best regards,
Prosenjit

June 11, 2024 at 9:44 am #15725616

aristotelisS-3

Hello, currently I am not experiencing any issue after the “permalinks update”. I hope this stays this way. Thank you for your support!

aristotelisS-3 confirmed that the issue was resolved on 2024-06-11 09:44:31.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.