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 1 reply, has 2 voices.

Last updated by Bobby 1 year, 2 months ago.

Assigned support staff: Bobby.

Author Posts
May 9, 2019 at 7:13 pm #3779057



I'm developing a headless multilingual site using the WordPress REST API to access Posts. I'd like to link from one post to it's translated version.

For instance, if requesting
hidden link

Is it possible to retrieve a link, slug or ID of it's translated version in the JSON response?

I believe my issue is similar to the one discussed here:

although I do not see the "wpml_current_locale" or "wpml_translations" referenced in Marcel's response.

Thank you!

May 10, 2019 at 6:59 pm #3787483


Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi There,

after running some tests and consulting with our developers it seems that this is not an expected result that is shown in the ticket here

The user has used some custom coding to get a specific result back from the wp-rest api

you can do this with custom code , here are some documentations that can help

additionally please review the following function another user shared in an older post

if you add it within your theme's functions.php it will enable to show the translates page as well with the original pages all in one page when just calling /posts/

add_action('rest_api_init', function () {
if (defined('REST_REQUEST') && REST_REQUEST) {
add_action('parse_query', function( $q ) {
$q->query_vars['suppress_filters'] = true;

unfortunately as this is custom coding we cannot provide further support within the forum but do recommend contacting our 3rd party contractors

The topic ‘[Closed] Slug or ID of translated post via REST API’ is closed to new replies.