Recently my client's website started to spin out of control in terms of resource usage. After a closer inspection using Query Monitor, it is clear that WPML_Element_Translation->maybe_populate_cache() being called in each and every page takes up to 98%+ load time and is so slow.
Is there a way to tame this function and remove those calls from the page loading flow or resolve their insanely long loading time?
Welcome to the WPML support forum. In WPML v4.6.7 and v4.6.9 we improved a performance issue related to WPML_Element_Translation. I can see that you already have 4.6.9 so you shouldn't experience performance issues.
I see that you already know how to use Query Monitor, could you please create a staging copy of your site and test WPML in a minimal environment?
Important: Always disable caching and security plugins when testing
- Run the same test if and without WPML activated
- Run the same test with a different theme from WordPress like 2020
- Disable any additional plugin that is not related to WPML and its add-ons. Then, please start reactivating the plugins one by one, or activate them in small groups. This way you can verify at which point the issue appears again.
General tips that can improve speed:
- In WPML > Settings", don't use "Translatable - use translation if available or fallback to default language" for Post types and taxonomies
- Delete untranslated strings to reduce the number of strings: https://wpml.org/documentation/getting-started-guide/string-translation/#how-to-delete-a-string
- Update your PHP version to 8+
- In "WPML > Support > Troubleshooting(link)", run "Remove ghost entries from the translation tables" and "Cleanup and optimize string tables"
The topic ‘[Closed] WPML_Element_Translation->maybe_populate_cache() takes ages to load in each page’ is closed to new replies.