Problem: After installing the WPML plugin and activating languages, everything works except when logging in as an administrator, which triggers a fatal error. The error message indicates an issue with DOMDocument::loadHTML() due to an empty argument in the WPML String Translation plugin. Solution: We recommend two approaches to resolve this issue: 1. Disable automatic string registration by navigating to WPML → String Translation and turning off the “Auto register untranslated strings” option. 2. Apply a manual fix in the plugin. Navigate to: wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/StringHtml/Repository/HtmlStringsRepository.php and update the function
readAllRawGettextStringsFromHtmlScriptTags
as follows:
private function readAllRawGettextStringsFromHtmlScriptTags( \DOMDocument $dom, string $html ): array {<br /> // We cannot read here with xpath - script tags contain code from the JS template engines and some html will be broken.<br /> // (For example some elements will miss closing tags).<br /> $pattern = '/<script.*?type="text\/(?:html|template)".*?>([\s\S]*?)<\/script>/i';<br /> preg_match_all( $pattern, $html, $matches );<br /> $scriptHtmls = [];<br /> foreach ( $matches[1] as $match ) {<br /> if (!empty($match)) {<br /> $scriptHtmls[] = $match;<br /> }<br /> }
Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.
Problem: Sie sehen eine Warnung auf der Übersetzungsseite, dass Ihre Webseite nicht die Mindestanforderungen von WPML erfüllt. Dies wird durch eine Wechselwirkung zwischen WPML und dem Plugin „WooCommerce Vehicle Parts Finder – Make/Model/Year/Engine/Category/Keyword“ verursacht, das serialisierte Daten in Cookies speichert. Diese serialisierten Cookies führen dazu, dass die interne REST-Prüfung von WPML fehlschlägt. Solution: Als temporären Workaround können Sie die Art und Weise ändern, wie WPML Cookies während der REST-Prüfung filtert. Sie sollten die Methode
anpassen. Ersetzen Sie die Methode durch eine Version, die serialisierte Cookies ignoriert. Dies ermöglicht eine erfolgreiche Durchführung der Prüfung.
Wenn diese Lösung veraltet erscheint oder nicht auf Ihr Problem zutrifft, empfehlen wir Ihnen, ein neues Support-Ticket zu eröffnen. Überprüfen Sie auch die bekannten Probleme und stellen Sie sicher, dass Sie die neuesten Versionen Ihrer Themes und Plugins installiert haben.
Problem: You are using the MEDIA translation plugin along with multilingual and multicurrency plugins, but they do not appear in the settings. Solution: We are aware of this issue and recommend that you ignore it for now. All WPML plugins will continue to function normally, and this should not affect your site. The fix for this issue will be included in one of our upcoming releases.
If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket at our support forum.
Problem: You are trying to display a translated global form using WPML on your Elementor site, but the form appears in the original English instead of the expected translation. Solution: This issue has been reported to Elementor and will be fixed in a future update of the plugin. In the meantime, we recommend adding the following code to your theme's functions.php file to ensure the Elementor global form is translated correctly. Please ensure you have a full backup of your site before proceeding.
// === WPML not translating contact forms FIX ===
if ( ! is_admin() ) {
add_filter( 'get_post_metadata', 'wpmlpb_735_translate_elementor_data', 10, 4 );
}
function wpmlpb_735_translate_elementor_data( $value, $object_id, $meta_key, $single ) {
// Only act on Elementor data
if ( '_elementor_data' !== $meta_key ) {
return $value;
}
// Temporarily remove this filter to avoid infinite recursion
remove_filter( 'get_post_metadata', 'wpmlpb_735_translate_elementor_data', 10 );
// Get the actual Elementor data
$elementor_data = get_post_meta( $object_id, '_elementor_data', $single );
// Re-add the filter
add_filter( 'get_post_metadata', 'wpmlpb_735_translate_elementor_data', 10, 4 );
// Process and convert dynamic elements if possible
if ( is_string( $elementor_data ) && ! empty( $elementor_data ) ) {
$data_array = json_decode( $elementor_data, true );
if ( is_array( $data_array ) && class_exists( '\WPML\PB\Elementor\Hooks\DynamicElements' ) ) {
$dynamic_elements = new \WPML\PB\Elementor\Hooks\DynamicElements();
$data_array = $dynamic_elements->convert( $data_array );
return json_encode( $data_array );
}
}
return $elementor_data;
}
Test this solution on a staging site first. If you encounter any issues or need further assistance, please do not hesitate to contact us. Additionally, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If this solution does not apply or is outdated, please open a new support ticket.
Problem: The client is experiencing Internal Server Errors when using WPML for string translations, which seem to be caused by redirects related to the .htaccess file being incorrectly overwritten. This issue is typically due to another plugin causing frequent rebuilds of WordPress rewrite rules. Solution: 1. Identify the plugin that is frequently calling
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your specific case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.
Problem: You have installed WPML on your site and are experiencing intermittent unavailability of the REST API. The REST API becomes unavailable across the entire site for about one minute, then returns before going offline again for a few minutes. Solution: We have identified that deactivating the WPLoyalty - WooCommerce Loyalty Points, Rewards and Referral Pro plugin resolves the issue. This plugin is currently not compatible with WPML. We recommend contacting the plugin author for more insights on the issue and to check if they can provide a solution. Meanwhile, if the plugin author indicates any direct relation of WPML to the issue, please inform us.
This solution might be outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.