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
- 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 -
- 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 -

Supporter timezone: Europe/Vienna (GMT+02:00)

Tagged: 

This topic contains 15 replies, has 1 voice.

Last updated by franz-josefG 13 hours, 59 minutes ago.

Assisted by: Bigul.

Author Posts
June 12, 2025 at 8:25 am #17128877

franz-josefG

Background of the issue:
I am trying to set a link on the image in the 'Media & Text' block of a WordPress page using WPML. The link should point to the translated version of the target page. I have created a test page to demonstrate the issue: hidden link

Symptoms:
In translated pages, the image link in the 'Media & Text' block still points to the target page in the default language instead of the translated version. The button on the left, linked to the same target page, works correctly in translated versions. I tried using the 'WPML->Settings': 'Translate Link Targets' -> 'Scan now and adjust links' feature, but it didn't fix the issue.

Questions:
Why does the image link in the 'Media & Text' block not point to the translated page?
How can I fix the image link to point to the correct translated page?

June 12, 2025 at 9:52 am #17129292

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

Welcome to WPML support. I will answer this ticket before the ticket is assigned to one of my colleagues.

Media & Text block does not seem to be a default WordPress block. Is it created by the plugin below?

https://wpml.org/de/plugin/spectra/

Or is it something else? If it is the Spectra plugin this might be a compatibility issue.

To be able to report the compatibility issues we need to replicate the issue on a clean installation.
I created a clean installation of WordPress, WPML, and all necessary WPML add-ons.
You can access the WordPress dashboard using the link below:
hidden link

Kindly follow the steps below:

- Install Spectra plugin.
- Add a sample page with Media and Text block.
- Try to replicate the issue.

This will help us to report the probable issue to the compatibility team and solve the possible problem faster.

If the source of the block is another plugin please give us the name to see if it is part of the tested plugins or not. if not you most probably will need to contact the developer of the plugin and consider using alternative compatible plugins:

https://wpml.org/plugin-functionality/gutenberg-blocks/

Thanks.

June 12, 2025 at 6:28 pm #17131236

franz-josefG

Hi Christopher,

The Media & Text block is a standard WordPress block:

https://wordpress.org/documentation/article/media-text-block/

I have created a test page with a similar setup on your sample site:

hidden link

There I was able to have the image in the translated page point to the translated target page AFTER I went to WPML -> Settings -> Translate Link Targets and clocked the "Scan now and adjust links" button.

Sadly, it doesn't work on my own site. I even tried disabling most plugins on my website (except the WPML plugins and the Site Optimization plugin but there I disabled caching) but the links on the images in the Media & Text blocks stubbornly refuse to update, even after going the "WPML -> Settings -> Translate Link Targets" route.

See for example:

hidden link

but also

hidden link

Any ideas?

Thanks,

Christophe

June 17, 2025 at 4:50 pm #17143465

Bigul
WPML Supporter since 01/2013

Languages: English (English )

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

Hello,

Sorry for the late response. Thank you for the details and for trying to reproduce the issue in the sandbox site.

Please fill in the private details fields after a full site backup. I would like to access the admin area of your site for further checking. Refer to the following links for more details about our private information sharing policies.

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

hidden link

--
Thanks!

Bigul

June 17, 2025 at 6:01 pm #17143613

franz-josefG

Hi Christopher,

I have worked some more on this issue. I have created a staging site of my site with a page exhibiting the problem here:

hidden link

Note that target links on the image are incorrect in the French and English versions of the page.

I have disabled all plugins except WPML plugins, and activated the standard WordPress Twenty Seventeen theme.

I also tried again WPML -> Settings -> Translate Link Targets -> "Scan now and adjust links", yet the link on the image in the translated pages is wrong.

Looks like a WPML bug.

Could you guys look into this? I can provide admin access to the staging site.

Thanks,

Christophe

June 17, 2025 at 6:05 pm #17143618

franz-josefG

Hi Bigul,

Looks like we were working in parallel on this problem. 🙂 How can I provide you with the credentials to log into the staging site?

My workday is finished but I'll be available tomorrow again.

Thanks.

Christophe

June 18, 2025 at 7:40 am #17144806

Bigul
WPML Supporter since 01/2013

Languages: English (English )

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

Hi Christophe,

Thank you for the details. I am enabling the private option for the next reply. Please share the staging site credentials for tracking this.

--
Thanks!

Bigul

June 19, 2025 at 3:37 am #17148546

Bigul
WPML Supporter since 01/2013

Languages: English (English )

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

Hi Christophe,

Thanks for the updates. I can see the issue on your test site. To check it further, can I make a copy of your site using the Duplicator plugin (https://wordpress.org/plugins/duplicator/) for detailed Debugging?

--
Thanks!

Bigul

June 20, 2025 at 7:49 am #17153038

franz-josefG

Hi Bigul,

Sorry for the late reply, I had a day off yesterday. Yes, you can make a copy of the site for detailed debugging, as long as you'll delete it once debugging is done.

Thanks,

Christophe

June 20, 2025 at 6:53 pm #17155165

Bigul
WPML Supporter since 01/2013

Languages: English (English )

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

Hi Christophe,

Thank you for the permission. I made a copy of the site. We will debug it further locally and get back to you as early as possible. Please wait.

--
Thanks!

Bigul

June 23, 2025 at 6:20 am #17158042

Bigul
WPML Supporter since 01/2013

Languages: English (English )

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

Hi Christophe,

I have done a few rounds of testing on both my local copy and your staging site.
On my local setup, the issue is resolved after the following steps. Refer to this screencast for reference: hidden link

- Go to WPML >> Settings >> Custom XML Configuration
- Add the following language configuration

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="core/image" translate="1">
      <xpath>//figure/figcaption</xpath>
      <xpath>//figure/img/@alt</xpath>
      <xpath type="link">//a/@href</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

- Make a minor update to the Test page to refresh translation settings
- Update the translations

However, the issue persists on the staging site. Could you please check if there are any server-side cache settings enabled? If yes, try clearing them and verify whether there is any difference in the result.

--
Thanks!

Bigul

June 24, 2025 at 7:17 am #17163218

franz-josefG

Hi Bigul,

I reactivated Siteground's caching plugin and caching functionality on the staging site, so that we can purge the cache on command.

I then tried to purge the cache, but the image links in the translated pages still don't point to the other translated pages.

I also changed the image link on the page in the default language, then updated the translated pages, and cleared the cache.

After this, the changed image links in the translated pages still point to (other) pages in the default language, so the problem doesn't seem to be related to caching...

June 24, 2025 at 7:58 am #17163347

Bigul
WPML Supporter since 01/2013

Languages: English (English )

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

Hello,

Thank you for the feedback. We are not able to reproduce the issue on the Sandbox site or in our local copy.

So, please check if there are any WPML-related errors in the server error log when the issue occurs. You may need assistance from your hosting team to access the log file.

--
Thanks!

Bigul

June 24, 2025 at 8:19 am #17163512

franz-josefG

Hi Bigul,

I have indeed php errors related to WPML in a php_errorlog:

[17-Jun-2025 11:58:31 UTC] PHP Warning: Undefined array key 0 in /home/customer/www/staging2.translations-by-engineers.com/public_html/wp-content/plugins/wpml-media-translation/classes/class-wpml-media-attachment-by-url-query.php on line 99
[17-Jun-2025 11:58:44 UTC] PHP Warning: Undefined array key 0 in /home/customer/www/staging2.translations-by-engineers.com/public_html/wp-content/plugins/wpml-media-translation/classes/class-wpml-media-attachment-by-url-query.php on line 99
[17-Jun-2025 16:46:32 UTC] Astra Addon: DB version updated!
[17-Jun-2025 17:16:23 UTC] WordPress database error Duplicate entry '4078-de' for key 'bvn_icl_translations.trid_lang' for query INSERT INTO `bvn_icl_translations` (`element_type`, `language_code`, `trid`, `element_id`) VALUES ('post_wp_template_part', 'de', '4078', '5808') made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WP_REST_Templates_Controller->update_item, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, WPML_Frontend_Post_Actions->save_post_actions, WPML_Post_Translation->after_save_post, WPML_Post_Translation->maybe_set_elid, SitePress->set_element_language_details, WPML_Set_Language->set, WPML_Set_Language->insert_new_row

Are these related to our problem?

Thanks,

Christophe

June 24, 2025 at 6:49 pm #17166469

Bigul
WPML Supporter since 01/2013

Languages: English (English )

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

Hello,

Thank you for the updates. This may be related, but please note that the warnings and errors were recorded a week ago.

I tried to reproduce them on my local copy by translating and updating the page translations, but they didn’t appear. It would be helpful if you could check whether you are still able to reproduce the warning and errors on your side.

Also, please check the server error log again for any recent entries that might help us.

--
Thanks!

Bigul