Is there a way to stop automatic translation for specific pages?
I have created a script that generates pages using XLSX files. I am using 5 separate XLSX files for different languages. The default language of my WordPress site is English.
When I use the NL, DE, or FR language sheets, those pages are not auto-translated, which is expected. However, when I use the EN sheet, the pages are automatically translated into other languages. I want to prevent this auto-translation behavior for pages created from the English sheet.
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
This has been escalated to our 2nd tier team team and may take some debugging time, I'll get back to you as soon as I have any news or questions for you.
I used my script to create pages in languages other than the default language (EN). As confirmed by your support, these pages should not be translated automatically. However, they are still getting auto-translated.
Please check this urgently, as it is creating issues in my setup.
Also, can you provide a meta tag or any functionality that I can add in my script to prevent these pages from going through automatic translation?
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
WPML provides a filter that can be used to exclude posts from automatic translation:
wpml_exclude_post_from_auto_translate
This filter cannot be applied based on post meta. The reason is that WPML creates translation jobs immediately after a post is created. At that moment, the post metadata does not yet exist, so it cannot be evaluated by the filter.
As a workaround, automatic translation can be temporarily disabled for all posts during the import process and re-enabled once the import is completed.
The filter should be added at the beginning of the handle_ajax_import function and removed before the final statement of the function. The filters should not be placed inside any if-else blocks.
All customizations previously added for this behavior should be removed.
This is custom implementation work. We are not able to debug the client’s custom code, but we can provide working examples to demonstrate the correct approach. The example above has been tested and works as expected.
We tested the solution you provided; however, it did not resolve the problem. We followed the exact steps you outlined, but unfortunately, it was not successful.
Could you please look into this matter? This is urgent for us.
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
Thank you for your patience while we reviewed this internally.
After further analysis, the correct approach is to prevent automatic translation during import when Translation Editor Advanced (TEA) is already running, without relying on post-meta–based filters that execute too late in the process.
To achieve this, the import logic should:
* Keep the existing code that prevents auto-translation during import when TEA is active
* Add a post meta during the import process, at the time the post is created:
* Meta key: _wpml_post_translation_editor_native
* Meta value: yes
Adding this meta at creation time forces the post to use the WordPress native editor. Posts using the WordPress editor are not translated using TEA, which ensures that no automatic translation jobs are created for imported content, even when TEA is enabled.
This approach avoids the timing issue where WPML creates translation jobs immediately after the post is created and before later metadata becomes available.
The topic ‘[Closed] Is there a way to stop automatic translation for specific pages? I have created a script that genera…’ is closed to new replies.