Home›Support›English Support›[Resolved] How do I get rid from 25000+ not used or linked to wrong translation data
[Resolved] How do I get rid from 25000+ not used or linked to wrong translation data
This thread is resolved. Here is a description of the problem and solution.
Problem: You have over 25,000 strings in WPML that are 'not used or linked to the wrong translation data', and you're unable to remove them efficiently through the interface due to the large volume and server limitations. Solution: If you're experiencing this issue, we recommend the following steps: 1. Ensure you take a backup of your site. 2. Download and activate the provided plugin from https://we.tl/t-BpP6RmeVea. 3. Append
?delete_strings=1
to your site's dashboard URL and reload the page. This will delete strings in batches of 5000. 4. Refresh the page multiple times until all strings are deleted, as indicated by a confirmation message. 5. Visit the WPML troubleshooting page and verify that there are no strings needing deletion. 6. Run the 'Cleanup and Optimize String Tables' step from the troubleshooting page. 7. Deactivate and remove the plugin after completion.
This solution is a temporary workaround. We are aware of the need for a more permanent fix and are working towards it. If this solution does not apply to your case, or if it becomes outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and ensure you have installed the latest versions of themes and plugins. If further assistance is needed, we highly recommend opening a new support ticket at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
From WPML > Support > Troubleshooting > Check from string issues, I get over 25000 strings
Which means I have over 25000 strings that are "not used or linked to the wrong translation data"
I understand I should get rid of them.
I also know I could adjust my server settings to allow longer/bigger requests. But let's face it: it's an edge case, and I won't make this setting adjustment for this request only, considering it will cause other issues (security, ...).
Symptoms:
Removing it through the interface doesn't work : I won't go through 265 pages of 100 results and click delete.
Alternatively, I know I can display all the results and tick them all and remove them all at once.
Unfortunately, the request will fail since it's way, way too long to process.
Questions:
Should I really get rid of these values, and if so, how can I do it efficiently? There must be a way. Thanks
It requires reloading back-end pages with an added url parameter to trigger the code a few times. It will delete strings 5000 at a time.
So, the steps are
- Take a backup
- Make sure you have taken a backup.
- Add the attached plugin file to the plugins/ folder and activate the plugin.
- Visit the site dashboard, then append ?delete_strings=1 to the URL and reload.
- You should get a message saying that x number of strings have been deleted.
- Refresh the page as many times as needed until it says there are no strings to delete.
- Go to the troubleshooting page and click the button to check from string issues again, which should now show 0 strings needing deletion. (This code uses the same query as on that page.)
- Also from troubleshooting, run the "Cleanup and Optimize String Tables" step.
- Deactivate and remove the plugin.
Link to plugin: hidden link
Please get back to us and let us know if this works.
- Is it necessary, or advised to get rid of these values?
- Are these all outdated, or wrong?
- What may I miss after removing them?
- Should I expect performance improvements after deletion, better stability, ...?
1) It is not necessary, it is only advised if you wish to do a clean up of unused / not translated strings.
2) No they are not, most of them are not used / translated so you can remove them if you do not wish to translate them. Other might be strings that do not anymore exist in source file, but are still showing in String translation.
3) You should not miss anything, as said there are either not translated or not existing strings or modified from source files and etc.
4) Some small improvements in performance may happen, since some data will be removed, so you can expect a bit lower DB table, which can give slight increase in load time, but probably not that much significant.
Ok, it seems to do the job. I could see it reduced, at each attempt, the remaining amount of values to clear.
Thank you.
If these values are always useless, for all users, whatever the setup, why not adding this script to WPML and run it as a daily cron? It would prevent this list from growing so much.
The script is just a quick workaround fix for your case, not something for general usage, a better solution and implementation from our side would probably be needed, issue is going to be escalated to developer and they will be working on proper fix / solution.