Issue: Translation is faulty or not updated
During the operation of a multilingual website with TranslatePress, sometimes you will encounter cases where the translation is faulty (for example: Chinese is displayed as Vietnamese) or you want to reset the entire translation of a specific post so that the AI translates it again from scratch.
This post will guide you through 2 ways to completely delete the translation of any post (Post, Page, Product…) without affecting other posts.
Method 1: Delete using SQL (Most Accurate)
This is the safest and most accurate method, helping you thoroughly delete data in the database.
Step 1: Find the Post ID
Access the WordPress admin page, go to the section Posts or Pages. Hover the mouse over the title of the post you want to process, look down at the browser's status bar, you will see the number ID (e.g.: post=123).
Step 2: Determine the post code and language table
- Post ID: For example, it is
123 - Language code to delete: For example, Chinese (China) is usually
zh_cn, English isen_us. The table name in the database will be in the formwp_trp_dictionary_vi_zh_cn(if translating from Vietnamese to Chinese).
Step 3: Run the SQL command
Open phpMyAdmin (or similar database management tool), find the website's database and run the following command:
-- Replace '123' with your post ID
-- Replace 'wp_trp_dictionary_vi_zh_cn' with the language table name you want to delete
DELETE FROM `wp_trp_dictionary_vi_zh_cn`
WHERE `original_id` IN (
SELECT `original_id`
FROM `wp_trp_original_meta`
WHERE `meta_key` = 'post_parent_id'
AND `meta_value` = '123'
);
After running, the entire translation of that post will be deleted. You just need to go to the homepage and reload the page, the system will automatically translate it anew.
Method 2: Use PHP Code (Quick and Simple)
If you are not familiar with the database or do not want to touch phpMyAdmin, you can use the following small code snippet.
Step 1: Add code to functions.php
Open file functions.php of the active theme (Appearance -> Theme Editor), and add this code to the end of the file:
add_action('init', function() {
// Change the number 123 to the ID of the post you want to delete
$TP4Tpost_id_to_clean = 123;
// Change to the language code you want to delete (e.g., vi_zh_cn, vi_en_us)
$TP4Tlang_pair = 'vi_zh_cn';
if (isset($_GET['clean_post_id']) && $_GET['clean_post_id'] == $TP4Tpost_id_to_clean) {
global $wpdb;
$TP4Tmeta_table = $wpdb->prefix . 'trp_original_meta';
$TP4Tdict_table = $wpdb->prefix . 'trp_dictionary_' . $TP4Tlang_pair;
// Check if the table exists
if ($wpdb->get_var("SHOW TABLES LIKE '$TP4Tdict_table'") != $TP4Tdict_table) {
wp_die("Table $TP4Tdict_table does not exist. Please check the language code again.");
}
// Get the list of string IDs belonging to this post
$TP4Toriginal_ids = $wpdb->get_col($wpdb->prepare(
"SELECT original_id FROM $TP4Tmeta_table WHERE meta_key = 'post_parent_id' AND meta_value = %d",
$TP4Tpost_id_to_clean
));
if (!empty($TP4Toriginal_ids)) {
$TP4Tids_placeholder = implode(',', array_fill(0, count($TP4Toriginal_ids), '%d'));
$wpdb->query($wpdb->prepare(
"DELETE FROM $TP4Tdict_table WHERE original_id IN ($TP4Tids_placeholder)",
$TP4Toriginal_ids
));
echo "Successfully deleted translation for post ID: " . $TP4Tpost_id_to_clean;
} else {
echo "No strings found to delete or the post has not been translated yet.";
}
exit;
}
});
Step 2: Run the delete command
After saving the file, access the following URL in your browser (log in as admin first):
https://website-cua-ban.com/?clean_post_id=123
(Remember to replace 123 with the post ID you entered in the code).
Step 3: Delete the code
After seeing the message “Successfully deleted translation…”, go back to the file functions.php and delete the code snippet just added for security and to keep the website lightweight.
Conclusion
Above are 2 methods to help you reset the translation for a specific post in TranslatePress. This is very useful when you change the original content too much or when the automatic translation is faulty.
Wish you success!

