• Hello! I use Translatepress on all of my multilingual sites, however for the first time I am encountering a problem where there is lag on site load.

    Using Query Monitor, I found that with TranslatePress enabled:

    • The site triggers ~174 database queries per page load.
    • Many of them are large SELECT queries like: SELECT tt.id, CASE WHEN ot.original IS NULL THEN ot.original ELSE NULL END AS ... FROM wp_trp_gettext_fr_fr ... LEFT JOIN wp_trp_gettext_original_strings AS ot ON ... These originate from TRP_Query->get_all_gettext_strings().
    • Total load time: ~6.9 seconds (compared to 0.6 s when TranslatePress is disabled).

    When I disable TranslatePress, the same page drops to:

    • 44 queries total
    • ~0.6 s load time
    • No visible lag

    Environment:

    • Hosting: o2switch (LiteSpeed servers, Redis & Memcached available)
    • Object cache (Redis) enabled
    • Builder: Bricks Builder 2.0.2
    • Multilingual setup: small site, 2 languages (french / english)
    • Other plugins: Slim SEO, CookieYes, Wordfence, WPCode, Litespeed Cache (none seem to be causing performance issues from my tests)

    Any help is welcome, thanks!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support Daniel

    (@danieldandu)

    Hello @annesophievax,

    Thank you for you message!

    TranslatePress stores all translations in your WordPress database. This means that when a page is loaded, the plugin retrieves the necessary translations from the database so it can display the correct content in the selected language.

    Because of this, you may notice additional database queries compared to when TranslatePress is disabled — that’s expected behavior. However, these queries are normally cached after the first load, and subsequent requests should be much faster.

    Some of the queries you noticed are related to gettext translations. These are texts that come from your theme or plugins rather than from your pages — things like “Add to cart,” “Leave a comment,” or other small interface phrases. TranslatePress scans these so they can also appear translated on your site.

    To improve your site’s loading speed, you can:

    First, please check to have the TranslatePress plugin up to date.

    We recommend you use a caching plugin. Cached pages are not processed on every page load. TranslatePress can be resource-intensive with large pages, but it depends on how much HTML content there is on one page.

    Another performance thing you might want to look for, is that we have a listener for Javascript strings that when it detects a text change on the page (say a particular JS script adds a notice), we query the server for a translation. This ajax call is also fast as it doesn’t go through the normal WordPress ajax, however, it can cause issues when there is a lot of traffic to your website.

    The good part is that you can disable this functionality from TP Settings -> Advanced tab –> Troubleshooting section –> Disable dynamic translation.

    Also, the Automatic translation memory can increase the loading time, so be sure you disable it from TP Settings –> Advanced tab –> Miscellaneous section for testing purposes.

    You should also try the Optimize TranslatePress database tables option from TP Settings –> Advanced tab –> Debug section to clear them. See if it helps.

    Otherwise, try to disable the gettext translation using the Disable translation for gettext strings option from TP Settings –> Advanced tab –> Debug section. One reason may be that you could have many gettext strings translated on your site.

    Please let me know if this changes improve your speed performance.

    • This reply was modified 5 months, 3 weeks ago by Daniel.
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.