Problem: The client is experiencing very slow performance on their website. A PHP X-Ray report identified WPML as the root cause. Despite updating WPML from version 4.6.12 to 4.6.13, the issue persisted. Solution: We discovered that the slow performance was due to specific theme code in
. The problematic code is a function designed to update the focus keyword for all posts of a certain type on every page load. Here is the code:
// Function to automatically update the focus keyword for all: sights<br />function update_focus_keywords_sights()<br />{<br /> $posts = get_posts(array(<br /> 'posts_per_page' => -1,<br /> 'post_type' => 'sights' //replace post with the name of your post type<br /> ));<br /> foreach ($posts as $p) {<br /> update_post_meta($p->ID, 'rank_math_focus_keyword', strtolower(get_the_title($p->ID)));<br /> }<br />}<br />add_action('init', 'update_focus_keywords_sights');
Removing this code reduced the site's load time from approximately 17 seconds to 4.5 seconds. We recommend removing or optimizing this function to improve performance.
If this solution does not apply to your case, or if it seems outdated, please check the related known issues and confirm that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket at WPML support forum.
Problema: El cliente está intentando mejorar el rendimiento de su sitio web y, tras activar WPML, observa un error en el log que indica un problema con las consultas de la base de datos. Solución: Para identificar la causa del problema de rendimiento, recomendamos seguir estos pasos: 1. Cree una copia de seguridad completa del sitio. 2. Actualice todos los plugins y temas que estén desactualizados. 3. Borre cualquier memoria cache existente. 4. Desactive todos los plugins, incluidos los de WPML. 5. Active un tema por defecto de WordPress, como Twenty Twenty. 6. Compruebe el rendimiento del sitio y haga una captura de pantalla. 7. Active los plugins de WPML y vuelva a comprobar el rendimiento del sitio, haciendo otra captura de pantalla. 8. Si el problema de rendimiento desaparece, reactive el tema y luego los demás plugins uno por uno hasta que el problema reaparezca. Esto ayudará a identificar el plugin o tema que está causando el conflicto.
Si estos pasos no resuelven el problema o si la solución propuesta resulta irrelevante debido a que está desactualizada o no se ajusta a su caso, le recomendamos abrir un nuevo ticket de soporte. También sugerimos revisar los problemas conocidos y confirmar que tiene instaladas las últimas versiones de los temas y plugins.
Problem: You are experiencing slow site performance when WPML is enabled on your website. Solution: We recommend following these steps to identify and resolve the issue: 1. Create a full backup of your site or set up a staging site as a copy of your production site. 2. Update any outdated plugins or themes. 3. Flush any existing cache memory. 4. Deactivate all plugins, including WPML plugins. 5. Activate a default WordPress theme, such as Twenty Twenty. 6. Reactivate the WPML plugins. 7. If the performance issue is resolved in this minimal setup, reactivate your theme and then other plugins one by one to identify the problematic component. Additionally, we suggest increasing the WordPress memory limit to 512M by adding the following line to your wp-config.php file:
Add this above the line /* That's all, stop editing! Happy blogging. */
If these steps do not resolve the issue or if the solution seems outdated or irrelevant to your case, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. We highly recommend opening a new support ticket for further assistance at WPML support forum.
Problem: The client is concerned about the high percentage of autoload data related to WPML in their database, questioning the necessity of autoloading certain entries like 'otgs-installer-log' and '_wcml_settings', and expressing concerns about the overall impact on website performance. Solution: We explained that the autoload entries are essential for WPML's functionality and should not be disabled. Although we are continuously working on performance improvements, these entries must remain as they are for now. We clarified that the size of these entries, such as 'icl_sitepress_settings', is relatively small (approximately 3.6 KB) and typical for plugins storing extensive settings. We suggested that the client tests their website's performance with and without WPML using tools like Page Load Time to gauge the actual impact. Additionally, we referenced a similar case discussed in our forums which might provide further insights: WPML forum discussion.
If this solution does not resolve your issue or seems outdated, we recommend opening a new support ticket. We also highly suggest 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 WPML Support Forum.