Is your PrestaShop store experiencing sluggish performance? It might be time for a database cleanup! As your online store grows, the database accumulates unnecessary data, affecting site speed and user experience.
Many PrestaShop sites unknowingly retain outdated, redundant data after upgrades, leading to an overloaded database. This adversely impacts site speed and, consequently, user satisfaction and conversions. Regularly cleaning your PrestaShop database is crucial for maintaining optimal performance and boosting sales.
Before initiating any cleanup, ensure you create a backup through phpMyAdmin. This precautionary step prevents accidental data loss.
Clearing connections statistics is essential for database health.
Execute the following SQL commands in the "SQL" tab:
TRUNCATE TABLE ps_connections;
TRUNCATE TABLE ps_connections_source;
TRUNCATE TABLE ps_connections_page;
Remove unnecessary logs from the database.
Execute SQL Query: TRUNCATE TABLE ps_log;
Continue with similar steps for other sections such as page not found errors, referrer statistics, store search statistics, mail logs, and expired product prices. Ensure to follow precise SQL commands for each category.
The "ps_pagenotfound" table stores data related to “page not found” errors (404 errors). To maintain a clean database, execute the following SQL query:
TRUNCATE TABLE ps_pagenotfound;
This step ensures that irrelevant data from 404 errors is removed, promoting a smoother database operation.
Clearing referrer statistics is essential for a clutter-free database. Execute the following SQL commands to achieve this:
TRUNCATE TABLE ps_referrer;
TRUNCATE TABLE ps_referrer_shop;
TRUNCATE TABLE ps_referrer_cache;
By removing referrer statistics, you optimize your database for improved performance.
Run the following command to truncate the "ps_statssearch" table:
TRUNCATE TABLE ps_statssearch;
This step eliminates unnecessary search statistics, contributing to a more efficient database.
Execute the SQL query below to clear the mail log from the "ps_mail" table:
TRUNCATE TABLE ps_mail;
Removing mail logs helps free up space in the database, ensuring optimal functionality.
To maintain accurate pricing information, execute the following SQL commands:
DELETE FROM `PREFIX_specific_price` WHERE `to` != '0000-00-00 00:00:00' AND `to` < NOW();
DELETE FROM `PREFIX_specific_price_rule WHERE `to` != '0000-00-00 00:00:00' AND `to` < NOW();
Note: Replace "PREFIX" with your database prefix, for example, "ps_specific_price."
Using your hosting or FTP credentials, log in and navigate to the "PRESTASHOP_ROOT/img/tmp" folder. Delete all files in this folder to remove temporary images.
Removing temporary images contributes to freeing up storage space and streamlining database performance.
Clear Smarty cache for optimal performance:
TRUNCATE TABLE ps_smarty_cache;
TRUNCATE TABLE ps_smarty_last_flush;
TRUNCATE TABLE ps_smarty_lazy_cache;
These steps ensure a thorough cleanup of your PrestaShop database, promoting efficient operation and contributing to enhanced website performance. Regularly scheduling these cleanups is essential for the long-term health of your online store's database.
Manually cleaning your PrestaShop database can be tedious. Introducing our Super Speed module! This ultimate tool streamlines the cleanup process, allowing you to clear connection logs, page views, discount codes, abandoned carts, and guest data effortlessly.
Say goodbye to manual cleaning and supercharge your database maintenance with the Super Speed module! Ensure your PrestaShop store operates at its best by scheduling regular cleanups following our comprehensive guide.