How to Manage and Clean Up TranslatePress Database Tables
Content
Many users of the 'Translate Multilingual sites – TranslatePress' plugin encounter issues with their database tables growing in size or containing unwanted data. This guide explains why this happens and provides common solutions for managing these tables safely.
Why TranslatePress Creates Database Tables
The plugin stores all translation data in dedicated database tables to provide fast access to translated content. The main tables you'll encounter are:
- wp_trp_original_strings: Stores the original text content
- wp_trp_dictionary_*: Contains translations for each language pair
- wp_trp_gettext_*: Stores translations for dynamic text (gettext strings)
- wp_trp_original_meta: Contains metadata about the original strings
Common Issues and Solutions
1. Unwanted Strings in Translation Tables
TranslatePress automatically detects and stores all text content from your site, which can include user-generated content, spam search terms, or even URLs.
Solution: You can exclude specific elements from translation to prevent them from being added to the database. This is done by adding CSS selectors to the exclusion list in the plugin's Advanced settings.
2. Large Database Tables
The translation tables can grow significantly over time, especially on active sites.
Solution: You can safely delete untranslated strings from the dictionary tables. Before doing this, always create a database backup. The plugin will regenerate necessary strings when pages are visited again.
3. Orphaned Database Entries
Even after uninstalling the plugin, some database entries might remain.
Solution: Entries like 'translatepress_avg_affiliate_id' in the wp_options table can be safely deleted if you're not using the plugin. Always backup your database before making changes.
4. Translation Data Reappearing
Some users report that deleted translations reappear over time.
Solution: This typically happens when the original content changes slightly, creating a new string that needs translation. The plugin doesn't overwrite existing manual translations unless the original string changes.
5. Database Update Loops
During plugin updates, you might encounter endless loops like "Removing duplicated dictionary strings for language..."
Solution: This is often caused by incomplete previous updates or corrupted tables. The TranslatePress team suggests dropping tables with date stamps at the end of their names and then saving the General settings to regenerate proper tables.
Important Precautions
Before making any changes to your database:
- Always create a complete database backup
- Test changes on a staging site first
- Be cautious when deleting data from tables directly
- Understand that some strings will be regenerated when pages are visited
While direct database manipulation is possible for advanced users, most translation management should be done through the plugin's Translation Editor interface to avoid unexpected behavior.
Related Support Threads Support
-
How can I delete or modify the translated data?https://wordpress.org/support/topic/how-can-i-delete-or-modify-the-translated-data/
-
Wp_options and your pluginhttps://wordpress.org/support/topic/wp_options-and-your-plugin-2/
-
Spam strings in table wp_trp_original_stringshttps://wordpress.org/support/topic/spam-strings-in-table-wp_trp_original_strings/
-
Deletehttps://wordpress.org/support/topic/one-language-translation/
-
Edit entries in the trp_dictionaryhttps://wordpress.org/support/topic/edit-entries-in-the-trp_dictionary/
-
Delete Empty ‘translated’ strings is it safe?https://wordpress.org/support/topic/delete-empty-translated-strings-is-it-safe/
-
“Removing cdata dictionary strings for language” repeating continuouslyhttps://wordpress.org/support/topic/removing-cdata-dictionary-strings-for-language-repeating-continuously/
-
Translations Keep Reappearing in Default Language (English) Even After Deletionhttps://wordpress.org/support/topic/translations-keep-reappearing-in-default-language-english-even-after-deletion/
-
Database Size Maintenancehttps://wordpress.org/support/topic/database-size-maintenance/
-
Removing duplicated dictionary strings for language en_GB………https://wordpress.org/support/topic/removing-duplicated-dictionary-strings-for-language-en_gb/
-
Stop resetting db values?https://wordpress.org/support/topic/stop-resetting-db-values/