WPML Performance Optimization

WPML is quite a popular WordPress plugin used for almost every multi-language website. However, it often becomes a source of performance problems, particularly when used with a low-cost hosting provider.

Its primary function is to store each sentence or word that your website has in its database, in separate tables and maps for every post, page or product that the website has.
For this reason, you may add translations for each part of the page and reuse it in case it needs to be used multiple times.

When that page is requested by your website’s visitor – it starts building content after looking into hundreds of database record, taking it both word by word and sentence by sentence until whole content is prepared. As is evident, it is rather a data-intensive and CPU-intensive operation, and though WPML does work hard to optimize that process internally, there is still a lot of work that needs to be done and it usually never works well on basic hosting plans.

Of course, full page caching becomes a must in such case, but still not enough to make the regular website run fast, especially your WP-admin pages.
In order to keep WPML website performance acceptable, it is crucial to have your database in a good shape – it should not consume all your CPU power available and have enough of memory pool size allocated in your my.cnf to keep most of WPML tables in memory.

Here at WowPress, we allocate a minimum of 1GB RAM for MySQL memory pool and always use separate MySQL instance for such websites to avoid cache expulsion caused by other website queries.
Strings to translate are rather static and used in read-only mode majority of the time, which also makes a good candidate for application-level caching.

WPML doesn’t use WordPress Object Caching intensively, but caching at queries level might be used. As a part of our WordPress hosting services we ensure that queries using icl_strings, icl_string_translations, icl_translations, icl_string_pages, and icl_string_urls tables are cached well, that hit rates are high in production and that they are not invalidated during regular events such as post updates or pushing new comments. Those really have to be kept in the memory for as long as possible.

Lastly, keep a close eye on translation strings table size. Themes or plugins may generate exclusive content for each request and it may fall to those tables under certain situations. Remember that nothing will help if that happens to you – tables will grow substantially, MySQL will transfer an increasing amount of data and website will begin to die after a certain point. Keeping your WPML website clean is very crucial if you wish to make it work fast and efficiently.