Skip to content Skip to sidebar

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
- 8:00 – 13:00 9:00 – 13:00 9:00 – 13:00 8:00 – 12:00 8:00 – 12:00 -
- 14:00 – 17:00 14:00 – 18:00 14:00 – 18:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Europe/Zagreb (GMT+01:00)

Tagged: 

This topic contains 1 replies, has 2 voices.

Last updated by Bruno Kos 3 months, 3 weeks ago.

Assisted by: Bruno Kos.

Author Posts
September 9, 2025 at 12:00 am #17385162

kaitlinG

Background of the issue:
I am trying to expose some form fields for translation via string translation. The strings show properly and the translation values are saved, but they are not being applied on the front end. Changes work on my local environment. Logs show Zend OPcache API is restricted by "restrict_api" and seems to not be fetching the translation values from the database.

Symptoms:
Translations are not applying on the front end despite being saved and showing properly.

Questions:
Why are the translations not applying on the front end?
How can I resolve the issue with Zend OPcache API restriction affecting translation fetching?
is it some sort of cache config issue?

September 9, 2025 at 5:55 am #17385541

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

This looks like a server-side configuration issue rather than a WPML bug. The translations are saved correctly in the database, but on production the OPcache settings (specifically `opcache.restrict_api`) prevent WordPress from clearing cached PHP code. That’s why the old strings keep showing on the front end.

Could you please check with your hosting provider:

1. Is `opcache.restrict_api` enabled on production?
2. If yes, can they relax or disable it so WordPress can run `opcache_invalidate()`?
3. If that’s not possible, can they provide a way for you to clear OPcache manually (via control panel, server command, or a button in the hosting dashboard) without having to restart PHP-FPM?
4. If restarting PHP-FPM is the only option, please confirm whether this can be done safely without downtime.

Also note the following:

* WPML String Translations are not fetched directly from the database, but from compiled .mo files. Sometimes these need to be regenerated. You can do this via WPML → Support → Troubleshooting → Show custom MO Files Pre-generation.
* We have also released new versions of WPML. Please update the plugin through WP Admin → Plugins → Add New → Commercial (/wp-admin/plugin-install.php?tab=commercial) and check if the issue persists after updating.

The main requirement is to ensure OPcache can be cleared and the .mo files are up to date, so that updated translations apply immediately.

Can you try the above and let me know if it helps?

The topic ‘[Closed] Custom Plugin string translation not working’ is closed to new replies.