This article gives you a brief overview of important topics related on how to optimize WordPress database with WPML.
WordPress is a very popular content management system with a vast plugin ecosystem. When it comes to multi-language plugins leaders are TranslatePress, WPML, Polylang, MultilingualPress. Each of these solutions has pros and cons, but they all increase complexity in the WordPress database.
When we are considering e-commerce services, database speed is very important for user experience. Very quickly we end up having lots of products. Furthermore, lots of product revisions, multiple images, comments, etc.
These are only some of the elements that influence web site speed and database optimization. Introducing a multi-language mechanism as an additional feature to e-commerce service (or online shop if you prefer better) creates an additional layer of complexity to be handled.
This additional layer of complexity is the reason for web site slowdowns. This is why most website owners spend large amounts of time thinking about various ideas to cope with optimizations.
Let’s take, as an example, WordPress based website, with a WooCommerce shop, with 100+ products. This site has several payment gateways, and a multi-language mechanism implemented with one of the popular multi-language plugins, such as WPML.
WPML support forums are full of various questions on how to optimize WPML database size. It’s important to understand that WPML is a premium and reliable product, but IT IS an additional layer to an already existing website.
This means that the quality of the site alone will, of course, influence the behavior of this or any other plugin.
However, website owners and developers can optimize databases. Even more, they can make their web sites run faster with WordPress + WPML + (probably) WooCommerce + various additional plugins. In order to separate concerns better we can divide optimizations into two sections:
We can describe the WordPress database optimization process in several steps.
Additionally to these steps, you can always improve other general things. For example, you can set up proper JS and CSS minification to boost your website performance. If you take care that your website loads fast, this will be beneficial for the whole user experience, including the WPML part.
The database size issue is a common issue with large-scale WPML web sites. We can resolve this with the latest versions of the WPML plugin and sub-plugins.
Having that in mind, you should update all WPML related plugins to the latest versions and manage to maintain your WordPress website in the right way.
This is indeed common advice, but lots of website owners won’t update their sites, either because of being afraid of bugs or because they don’t have a license anymore.
On support forums, most of the users state that their database size increased after installing and setting up WPML.
This information is not enough to properly optimize the WordPress database with WPML.
Firstly, the database is built with multiple tables. Furthermore, each of these tables inside the database should be monitored separately. This way, the web site owner is able to compare table-level sizes and to figure out which actual table increased in size more than expected.
Secondly, WPML is the only additional layer to your WordPress installation. Therefore it will behave differently on different WordPress websites.
Having this in mind, it’s not possible to understand the problem if you simply track a top-level issue, meaning the size of the database.
Finally, we need to track the size of each table separately. This way we understand how to properly optimize the WordPress database with WPML. Only then, we can locate the problem source.
WPML translates pages by creating copies of pages/posts etc.
Meaning, it’s expected to have increased size with every newly introduced language.
icl_translations
, so this table should be monitored for size changes. icl_string_translations
. You should monitor these tables to be sure that the database size actually increased because of WPML.You can find more information about the WPML database structure within the formal documentation. There is one great and detailed post about this.
It is not possible to guess what will happen to WPML database size when installed on a specific website, but for things like this, we do have staging areas.
It is highly recommended to create a staging website instance. Then install WPML and implement all multi-language settings there. Test everything and examine database sizes. After that, use speed and SQL query tests on both sites (original and staging with WPML).
With this, it is possible to determine existing issues. Remember, a proper understanding of the issue is usually 50% of the solution.
This is a better approach than simply assuming what will happen.
There are several quick steps to implement WPML database optimization:
This one seems like an elephant in the room, but it is usually poorly implemented or completely forgotten. Example of resolved issue: https://wpml.org/forums/topic/size-of-table-icl_string_pages/. This user had 400+ MB of string translations size, which is FIXED after updating to the latest version of the plugin.
Also, if you want to read about various blog posts related to WPML and recognized by WPML, you can visit this link.
If you want to optimize the WordPress database with WPML, this is a very important step.
Furthermore, this is used in cases where the translated page appears to be slower than its original. The complete tutorial can be found here https://wpml.org/faq/how-to-optimize-mysql-queries/
Long story short, you should consider two things:
WordPress database optimization, in general, is a complex subject and it will be elaborated on in future posts (link will be available here).
This article is about the code review best practices. It explains code review from the… Read More
API design is an important aspect of modern software development. It allows different systems to… Read More
This article sheds some light related to the question will ChatGPT or AIs in general… Read More
This article provides an overview of new features and deprecations in PHP 8.2. PHP 8.0… Read More
This article is about Automation and Artificial Intelligence in Software Engineering: Experiences, Challenges, and Opportunities.… Read More
PHP is getting more and more features. Enumerations in PHP are one of the latest… Read More