[Resolved] Media items disappearing for translated pages
This thread is resolved. Here is a description of the problem and solution.
Problem: When translating a website to Spanish, certain media items such as logos and social media icons disappear on the translated pages. The logo, added via a custom field from an ACF options page, does not appear in the Spanish version. Additionally, the media library shows no items when switched to Spanish, and an error message 'Sorry, you are not allowed to access this page' appears when trying to access the Spanish version of the Options page. Solution: 1. Ensure the ACF options page is translated. Go to the options page, switch to Spanish from the top admin bar, and either upload/select the logo for Spanish or re-save the options page if the field is set to Copy. More information can be found here: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#acf-options-pages 2. Set ACF field groups to not translatable as they can cause issues if set otherwise. Details on this setup are explained here: https://wpml.org/errata/advanced-custom-fields-field-group-should-be-set-as-not-translatable/ 3. Disable any role/restriction plugins and create a standard WordPress administrator user to resolve access issues. 4. Disable the 'Happy Files' plugin which causes the media library to appear empty in the secondary language. Run the Media Translation manual sync from WPML → Settings → Media.
If these steps do not resolve your issue, or if the solution seems outdated or not applicable to your case, we recommend opening a new support ticket. We also highly recommend checking related known issues at https://wpml.org/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 visit our support forum at https://wpml.org/forums/forum/english-support/.
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.
Could you please share a few example URLs where the issue can be seen?
Additionally, please go to Media → Library, switch the language from the top admin bar, and make sure that the images exist in the secondary language as well.
Let me know what you find and we’ll continue from there.
Hi, here is the link to the site on staging: hidden link
You'll notice that the logo in the top left disappears when switching the language to Spanish.
Also, upon switching the language in the Media Library, roughly 75% of the media items don't translate to Spanish. Please let me know how we can fix this, as this seems like it's the issue.
Let’s first check the logo issue. Could you please clarify how the logo was added in the default language? For example, are you using a header template or was it added via theme options?
This will help determine why it disappears in Spanish.
Since you’re using a header template with the logo coming from an ACF options page, you’ll also need to make sure the options page is translated.
Please try the following:
- Go to the options page
- Switch to the secondary language (Spanish) from the top admin bar
- Either upload/select the logo for Spanish, or simply re-save the options page (if the field is set to Copy)
This should make the logo appear correctly in the translated header.
Regarding the “Sorry, you are not allowed to access this page” message, this is not coming from WPML. It is related to user roles/permissions on your site, likely due to a roles or temporary access plugin.
It seems the current user does not have all required capabilities to access the options page.
I recommend temporarily disabling any role/restriction plugins and creating a standard WordPress administrator user, then trying again with that account.
Let me know once done and if you still have issue.
I see that ACF field groups is now set to "not translatable".
I also am now able to access the Spanish version of the options page. It shows the image is there. However the logo is still not dispalying in the header on the frontend.
hidden link
Notice in the following screenshot how there are no media items on the Spanish version. I think this is the issue and reason why the media items are not displaying on the Spanish version of the pages.
I checked your setup and the issue with media not showing in the secondary language is caused by the “Happy Files” plugin. It seems to return an empty media library for the second language.
When I disabled the plugin, the media appeared correctly. I also ran the Media Translation manual sync from WPML → Settings → Media, and after that everything worked as expected.
- hidden link
Please note that this plugin is not officially compatible with WPML, so issues like this can occur. I would recommend reaching out to the plugin author and reporting this. If they are open to it, our compatibility team would be glad to work and collaborate with them.