Skip Navigation

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

Media files not displaying on secondary language in Media library, When domains per language are used

Add the below code to theme (child theme) funcitons.php

add_action( 'init', function() {
        remove_all_filters( 'upload_dir' );
} );

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 17 replies, has 3 voices.

Last updated by Tsuyoshi 1 year, 6 months ago.

Assigned support staff: Raja Mohammed.

Author Posts
July 4, 2019 at 10:02 am #4142195

Raja Mohammed

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi there,

Please disable the plugin "Enhanced Media Library" and any other plugin related to media and Images, Check if the issue still persists. The case seems like a conflict with some other plugin which is trying to access the images using the primary domain.

Try adding the below code in your theme (child theme) functions.php file.

add_action( 'init', function() {
        remove_all_filters( 'upload_dir' );
} );

Please let me know the results

Kind regards

July 4, 2019 at 6:30 pm #4145881


Deactivating plugin didn't affect anything but your code resolved all issues.
Thank you so much, Raja!

July 4, 2019 at 6:31 pm #4145887


My issue is resolved now. Thank you!