Skip Navigation

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

Problem:
The client is experiencing an issue where a custom post type (CPT) added using Advanced Custom Fields (ACF) is restricted to a single language and is not visible in all languages, even after setting the post type to "Translatable" in WPML settings.

Solution:
1. Ensure that the WPML plugin and its add-ons are updated to the latest version for optimal functionality and bug fixes. Instructions for updating can be found here: http://wpml.org/faq/install-wpml/.

2. If the issue persists after updating, try the following steps:
- Go to WPML → Settings page.
- Click on the "Custom XML Configuration" tab.
- Add the following configuration and save:

<wpml-config><br />  <custom-types><br />    <custom-type translate="0" >newwpmltest</custom-type><br />  </custom-types><br /></wpml-config>

- Create a new CPT using ACF named "newwpmltest" and check the results.

For more information on custom XML configuration, visit: https://wpml.org/documentation/support/language-configuration-files/#custom-types.

3. If the problem still occurs, consider creating a CPT using another plugin, such as the Toolset Types plugin, which can be downloaded from: https://wpml.org/account/downloads/.

If this solution does not seem relevant to your situation, please open a new support ticket with us for further assistance: Contact WPML Support.

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: 

This topic contains 18 replies, has 2 voices.

Last updated by Nikhil Vishwanath 1 year, 1 month ago.

Assisted by: Andrey.

Author Posts
October 25, 2023 at 10:45 am #14659833

Nikhil Vishwanath

Hi,

We have added a custom post type using ACF but it seems to be restricted to only a single language.

We would like to have all the posts in this post type to be visible in all languages. Is that possible with any setting in the WPML?

I tried to follow an example mentioned in a similar query which suggested making the changes in the WPML Settings > Post Types Translation. After saving the post type to be "Translatable" it is not getting reflected.

I would like to have your assistance/input on this.

October 25, 2023 at 8:39 pm #14664739

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Thank you for contacting WPML support.

Once you set it Translatable for CPT, it should be possible to translate. Have a look at the following article: https://wpml.org/documentation/getting-started-guide/translating-custom-posts/

Could you please update your WPML plugin to the latest version 4.6.7 and add-ons to benefit from the latest bug fixes and improvements? This may not necessarily resolve your problem, however, in order to troubleshoot the issue best we need to work on the latest code available.

You can check the latest released versions under "My Account -> Downloads" on this site. Instructions to update can be found here: http://wpml.org/faq/install-wpml/

Please remember to back up your database first before you proceed.

If this is still the problem, please upload screenshots showing this.

October 26, 2023 at 7:53 am #14667163

Nikhil Vishwanath

Hi Andrey,

Thank you for your response.

I have updated the WPML plugin and changed the Post type translation settings for the custom post type on the site.

But my issue is that all the posts in this post type are present in only one language, English.

Previously, we had programmatically created a few custom post types on our site using a custom plugin and the posts within them can be accessed through any language.
Example in the uploaded image: Custom post type called "Files"

Now, we have decided to migrate the posts into new custom post types created using ACF. Due to this, the posts in the new CPT are only shown or accessed in one language, which is primarily set during the creation of the CPT.
Example in the uploaded image: Custom post type called "Sessions"

There are thousands of posts in this custom post type and they all vary in languages so it would be difficult to manually assign languages to each individual post if we try to go that way.

My question is, can we have the new CPT not associated with any default language?

Please let me know if you need any other details from my end.

Thank you.

CPT - Sessions.png
CPT- Files.png
October 30, 2023 at 2:01 pm #14692709

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Thank you for providing more details.

What you have described is expected behavior. The screenshot with CPT Files shows no language associated with it, as it is probably set Not to be Translatable. You can do the same for CPT Sessions by setting it to Not translatable in WPML → Settings → Post Types Translation. Please remember that in this case, custom posts of CPT have no language and cannot be translated.

October 31, 2023 at 9:33 am #14697883

Nikhil Vishwanath

Hi Andrey,

I have reverted back to changing the post-type translation setting in WPML and set the custom post type as Non-Translatable.

I don't think the issue is clear here.

When we add a custom post type using ACF, we get the option to select the language for that particular post type. We do not want this post type to be specific for any language as it contains posts from all languages combined in it.

Refer to the screenshots -
1) Post types in ACF - hidden link

2) Language dropdown for the post type example - hidden link

Maybe this is an issue within the ACF multilingual setting itself but I'm not sure so I wanted to check if it is possible to make a setting or config in WPML so that any post types we create using this can be used in all languages.

Please let me know if you need any other details from my end.

Thank you.

October 31, 2023 at 10:05 am #14698189

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

I understand the issue you reported and appreciate the explanation. To address the problem, you can go to WPML → Settings → Post type translation and set it to "Not Translatable". This should display the same view as in your screenshot for CPT Files.

It seems there may be some confusion about how WPML operates. The screenshot you provided with CPT Files indicates that the post type is set to "Not translatable". This does not mean that posts are available in all languages as they do not have any language. It simply means that this post type contains posts from all languages and was initially translatable but eventually set to "Not translatable".

Regarding your question about making a setting or config in WPML that allows post types to be used in all languages, the solution is to set the CPT to "Not translatable".

October 31, 2023 at 10:15 am #14698235

Nikhil Vishwanath

Hi Andrey,

I appreciate the response.

We have set the CPT as "Not translatable" but when we change the language, the CPT is not visible anymore in the admin dashboard sidebar.

I think this is because we have to select a language first when we create a CPT but we do not want to do that.

If you see the attached screenshot in my previous message, there is a language dropdown selection when we create the new CPT. Due to this, the CPT is only associated to that particular language, but the posts within it are in different languages so that is the issue we are facing.

Reference - hidden link

When I am on a CPT page as an admin and change the language, I see the WP error message "Invalid Post Type" because this post type does not exist in that language.

How can we make this custom post type not be associated with any language? Maybe there is a code we can execute?

Please let us know.

Thank you.

invalid post type.png
October 31, 2023 at 11:06 am #14698825

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)


We have set the CPT as "Not translatable" but when we change the language, the CPT is not visible anymore in the admin dashboard sidebar.

I think this is because we have to select a language first when we create a CPT but we do not want to do that.

How can we make this custom post type not be associated with any language? Maybe there is a code we can execute?

Please create a new test post with ACF and choose Do not make 'Post Types' translatable so you do not have to select a language then.

Edit-Post-Type-“Movies”-‹-WCML-Plugin-GUI-—-WordPress.png
October 31, 2023 at 11:11 am #14698893

Nikhil Vishwanath

I do not see this option when I add a new post type in ACf

It shows the Language selection dropdown by default as the first option

screencapture-dharmasun-shedrubdev-site-wp-admin-post-new-php-2023-10-31-16_40_23.png
October 31, 2023 at 3:36 pm #14701949

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

You need to ensure that all plugins are updated, including ACF. Additionally, ensure that Advanced Custom Fields Multilingual is activated. Please remember to back up your database before proceeding.

November 1, 2023 at 6:14 am #14705299

Nikhil Vishwanath

Hi Andrey,

I have checked the plugins are updated.

WPML CMS - v4.6.7
WPML String Translation - v3.2.8
ACF Pro - v6.2.2
Advanced Custom Fields Multilingual - v2.0.5

Please let me know if anything is missing here.

Thank you.

November 1, 2023 at 4:55 pm #14709283

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

OK, I understood. You are on a multisite installation. This meta box is not present there. But try the following, and I have tested this, too:

– Create a new CPT
– Set it to not translatable in WPML → Post type translation
– Only after creating or importinf your posts to a new post type

This should help.

November 2, 2023 at 6:31 am #14712571

Nikhil Vishwanath

The issue is that when I create a new post type, the Language selection metabox is there by default and it is set to English.

So when I migrate the posts from one CPT to the new one I create, they are all in "English" language only.

"– Only after creating or importing your posts to a new post type"
Can you please clarify this point you mentioned?

Thank you.

November 2, 2023 at 8:45 am #14713485

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)


The issue is that when I create a new post type, the Language selection metabox is there by default and it is set to English.

As I mentioned before this is expected behavior.

Sorry for not being clear, let me clarify:

– You create a new CPT, even if the Language selection metabox is there

– Set the new CPT to not translatable in WPML → Post type translation. Now, the Language selection metabox is not there

– Go to your newly created CPT create a post, and check the results.

November 6, 2023 at 5:11 am #14734475

Nikhil Vishwanath

Hi Andrey,

Thank you for the response.

I have tried your suggestion but the new CPT I added is still not visible in other languages.

- I added the new CPT "WDMTest" in ACF
- The WPML post type translation setting was already "Not translatable" when I checked it.
- I created a new post under the new CPT and checked in other languages.
- The language selection dropdown/metabox did not go away in ACF

I have attached a few screenshots here for reference.

Please let me know what other options I have. Is this not possible with ACF multilingual and WPML config?

Thank you.

new cpt french.png
new cpt in en.png
new cpt test.png
wpml settings.png