Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Europe/Kyiv (GMT+03:00)

Tagged: 

This topic contains 1 reply, has 0 voices.

Last updated by Andrey 3 days, 15 hours ago.

Assisted by: Andrey.

Author Posts
July 16, 2025 at 3:12 pm #17242853

nielsS-9

Background of the issue:
I have my own custom plugin which has implemented a custom post type. If a user has their current language set to a non-default language, such as Dutch, and they create the custom post type, it is associated with the current language by WPML. I tried adding 'lang' => 'all' as an argument to WP_Query parameters but did not get a positive result.
Note that if a user creates the custom post type it will have a post_status pending. WP_Query is used to retrieve an overview of all custom posts with this status.

Symptoms:
When performing a WP_Query for the custom post type, only records in the default language are shown, and records in other languages, like Dutch, are filtered out.

Questions:
How can I modify WP_Query to include custom post types in all languages?
Is there a specific WPML setting that needs to be adjusted to display custom post types in non-default languages?

July 16, 2025 at 4:55 pm #17243099

Andrey
WPML Supporter since 06/2013

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

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

Thank you for contacting WPML support.

If you want to retrieve posts from all languages, you need to use the suppress_filters argument in your query.
• Set suppress_filters = true to fetch posts from all languages.
• Set suppress_filters = false to get posts only in the currently viewed language.

You can find more information here:
https://wpml.org/documentation/support/achieving-wpml-compatibility-for-your-themes-and-plugins/#filter-correct-ids