Skip Navigation

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 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 0 replies, has 0 voices.

Last updated by shaneP-4 1 day, 3 hours ago.

Assisted by: Waqas Bin Hasan.

Author Posts
January 24, 2025 at 8:22 pm #16632583

shaneP-4

<b>Background of the issue: </b>
I have a headless WordPress site with English (en) and German (de) pages, using WPGraphQL with the WPML GraphQL plugin to query pages. English is the default language. I am trying to query all German pages using the following query:

query {
  pages(where: {language: "de"}) {
    nodes {
      isFrontPage
      languageCode
      uri
      title
    }
  }
}

Link to a page where the issue can be seen:

<b>Symptoms: </b>
The query returns pages with URIs that include the language in the path, like /de/about/, but the front page URI is just / instead of /de/. This causes issues because I can't query a localized front page. Using

page(id: "/", idType: URI)

returns the English front page, while

page(id: "/de", idType: URI)

and similar variations return null. However, querying

page(id: "/de/about", idType: URI)

correctly returns the German about page.

<b>Questions: </b>
Why does the front page URI not include the language code for German?
How can I correctly query the localized front page using WPML GraphQL?

[EDIT: I really hope you didn't just AI-SLOP my carefully crafted, detailed support ticket that i spent half an hour on writing, and removed like 80% in the process????]

[EDIT 2: Yes you did. That's not a good experience.]

January 27, 2025 at 10:20 am #16636963

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support and I hope it is OK to continue in English.

First of all please accept our apologies if something was stripped out of your first message. Usually it doesn't happen, perhaps the message wasn't submitted correctly or may contain such code or content which may have been filtered out.

However can you please add those details again? You can use "code" tag to add your code as you did already or can add screenshots or share a video showing the details.

Besides this, I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in the admin and on the frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

P.S.: If you don't see the section for providing access information, do not write in the message box or the information may appear as public.

Regards.

January 29, 2025 at 7:51 am #16644605

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the access and the details.

I am working on this and 'll get back to you as soon as I find something or have a solution.

January 29, 2025 at 12:52 pm #16646559

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation. I am working on this and 'll get back to you as soon as I find something or have a solution.

January 30, 2025 at 6:55 am #16649528

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation. I've observed the issue in your test site and discussing with the team.

I'm also preparing a local test environment to check in more detail, so I can escalate the issue, if needed.

I'll update you soon on this.

January 30, 2025 at 1:17 pm #16651790

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation. Before closing today, I was just wanted to update you that I've prepared my local setup and testing things in there.

I'll update you on this by tomorrow.

January 31, 2025 at 5:26 am #16653922

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation. I was able to reproduce the issue in a fresh setup and 've escalated the matter to our 2nd tier team for further investigation.

I'll update you as soon as I have more information.

January 31, 2025 at 6:25 pm #16656936

shaneP-4

Hey Waqas,
thanks so much for continuing to dig into this!
I'm wondering if we can reenable the plugins again?
Cheers!