Skip Navigation

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

Problem:
The client is facing issues with media translation in WPML. Specifically, they are unable to replace an English PDF with an Italian version, encountering problems with file submission and duplication, and observing that deleted media still appears in WPML media translation.
Solution:
1. Increase the WP Memory Limit to at least 128MB, preferably 256MB, to improve performance and potentially resolve the issue. This adjustment can be made in the wp-config.php file of the WordPress installation by adding the following lines:

/** Memory Limit */<br />define('WP_MEMORY_LIMIT', '256M');<br />define('WP_MAX_MEMORY_LIMIT', '256M');

Add these lines before:

/* That's all, stop editing! Happy blogging. */

2. By design, WPML does not allow selecting already uploaded media files for replacement; a new upload is necessary.
3. To ensure a media file does not appear in WPML's Media Translation after deletion, it must be removed from all language versions. This can be done using the Language Switcher in the media library.
For detailed guidance on setting WP Memory Limits, visit WPML documentation. Learn more about media translation settings at WPML Media Translation Settings.

If these steps do not resolve your issue, or if the solution seems outdated or irrelevant to your specific case, we recommend opening a new support ticket. We also highly suggest checking related known issues at WPML Known Issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please contact us through the WPML support forum.

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 5 replies, has 2 voices.

Last updated by Itamar 3 months, 3 weeks ago.

Assisted by: Itamar.

Author Posts
July 9, 2024 at 2:07 am #15916421

francescB-10

Background of the issue:
We have problems trying to introduce a custom media for an English PDF. we are trying to custom this media for Italian so when people click to download English PDF, they download the Italian for the Italian version of the website

Symptoms:

Questions:
Here is the problem we are experiencing

1 When we try to replace the English PDF with the Italian PDF, it is refusing to allow this file to be submitted. Please see video.
hidden link

2 When we try to replace the English PDF, it is only giving us the ability to upload a version rather than search for a version already in the WordPress library - this is creating duplications of pdf docs

3 When we delete from our WordPress media library all PDF assets except English version, mysteriously when we go to the WPml media translation, we can still see the old Media that we have deleted from WordPress media

I have shot a video here to help you understand more hidden link

July 9, 2024 at 6:44 am #15918154

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

We focus on one issue per ticket in our technical support forum. Otherwise, tickets can get cluttered and confusing for both users and supporters. In this ticket, I'll help you with the Media translation issue. For the other issue, please open a new ticket for each issue. However, I think you have already done it, and those tickets are already assigned to one of my colleagues.

1. Thanks for the video! Please correct the following and see if it helps.

The debug info you attached shows that your server WP Memory Limit is 40M. Our recommendations are to have the following as minimal requirements:

- PHP 7 and above (this OK with your installation) with a WP Memory Limit of at least 128MB while 256MB is recommended.

MySQL 5.6 and above.

Please follow this link for detailed documentation:

https://wpml.org/home/minimum-requirements/

You can also read about it here.

https://wpml.org/faq/checklist-before-opening-a-ticket-in-wpml-support/#how-can-i-increase-my-sites-memory-limit

Is it possible for you to change those to the minimum requirement?

You may need to contact your hosting provider for that. Meeting those baseline requirements is critical before debugging and sometimes solves issues you experience. The most important thing is to raise the WP Memory Limit. Please try to raise it before you contact your hosting company. You can do it from the wp-config.php file in your WordPress installation. Insert this code in that file:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Add it before this line:

/* That's all, stop editing! Happy blogging. */

Could you please perform that procedure and see if it helps?

2. It is like this by design. I'm sorry, but you cannot select an already uploaded media file. You must upload it from your computer.

3. When you add an image in Media -> Library, WPML duplicates this image to the other languages of your site. This is according to the settings in WPML -> Settings -> Media translation. You can read more about it in our guide here - https://wpml.org/documentation/getting-started-guide/media-translation/#accessing-media-translation-settings.

To prevent the media file from showing in WPML -> Media translation, you must delete it from all the languages. You can do it by switching the Language Switcher at the top admin bar while in the media library. Please see the attached screenshot.

Regards,
Itamar.

2024-07-09_09-38-55.jpg
July 10, 2024 at 12:59 am #15923877

francescB-10

great feedback - we are actioning this now

July 10, 2024 at 6:25 am #15925842

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Thanks!

I'll be waiting to hear if you need more help from me.

Otherwise, please mark this ticket as resolved.

Best Regards,
Itamar.

July 22, 2024 at 2:17 am #15984300

francescB-10

Hi Itamar,

We have done this, and images are working fine. The PDFs are still causing issue.

Can you please provide more guidance on what we can try to rectify?

We have added the PDFs manually on each page as a workaround for now.

Thanks,

July 22, 2024 at 2:43 pm #15987505

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I'm glad that the images are working fine now!

As I mentioned, we focus on one issue per ticket in our technical support forum. Otherwise, tickets can get cluttered and confusing for both users and supporters.

Please open a new ticket with the PDF issue and describe it in detail.

One of our supporters will continue to help you with it.

Thanks,
Itamar.