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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | - | 9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 |
- | - | - | - | - | - | - |
Supporter timezone: America/Lima (GMT-05:00)
Tagged: Compatibility
This topic contains 9 replies, has 1 voice.
Last updated by Andreas W. 1 hour, 12 minutes ago.
Assisted by: Andreas W..
Author | Posts |
---|---|
January 9, 2025 at 5:41 am #16575933 | |
alexZ-17 |
Background of the issue: Symptoms: Questions: |
January 10, 2025 at 12:16 am #16580099 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Hi there, How is the noindex tag added? Viewing the source I can verify that the noindex tag is not carried over to the translation. As a quick workaround you can manually edit the translation to ensure it's enabled. 1. Edit the page in the default language 2. Use the language switcher dropdown and switch to the secondary language (exit fullscreen if guttenberg is used) 3. Add the noindex tag if you are using a custom field to enable it and update |
January 10, 2025 at 11:46 am #16581876 | |
alexZ-17 |
It is added with HFCM plugin: Please answer the questions above and provide a proper solution ASAP! |
January 10, 2025 at 8:53 pm #16583313 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, Please go to WPML > Settings > Post Type Translation, check for the HFCM Code Post Type, and set it to "Translatable - only show translated items". Guide: Now, you should be able to translate these custom posts and create one code snippet per language. If you translate those custom posts with the WPML Translation Editor, you might need to take a look into WPML > Settings > Custom Field Translation and make sure that fields that come from this plugin are set properly to "Copy" or "Translate". Please read this: Take note, that if you implement a snippet per shortcode, then each shortcode in each language will have a unique ID. You would need to place those shortcodes manually on each page, post, or template in such cases. If this will not solve the issue, please let us know. Best regards |
January 11, 2025 at 12:35 pm #16583909 | |
alexZ-17 |
1. Your responce looks for me as not 100% relevant - may be you have confused me with somebody else. 4.Please answer my questions about your colleague’s proposal: |
January 11, 2025 at 3:02 pm #16584215 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Thank you for your message. I can see that the meta tag is not loaded here: I created a test site and tried to replicate the issue. You can see here on the "Sample Page" and its translation that the meta tag is appearing as expected: One-Click-Login: --- It seems that the minimum requirements are not met on the server: Could you please increase the WordPress memory limit (WP Memory Limit) to at least 256 MB? WPML requires at least 128M. Your current values are: PHP MemoryLimit 512M WP Memory Limit 40M You need to connect to your website's server and open the wp-config.php file in a text editor. The file is located in the WordPress root directory. Add this code to the wp-config.php file to increase WordPress memory: define ('WP_MEMORY_LIMIT', '256M'); Add this just before this comment: // That's all, stop editing! Happy blogging. The current values can be viewed under WPML > Support > WordPress. These settings can be restricted directly by your hosting provider. Therefore, I recommend contacting them and asking them to change them directly if the changes are not applied immediately. If adjusting the limit will not solve the issue, please let me know. |
January 11, 2025 at 6:10 pm #16584567 | |
alexZ-17 |
1. Regretfully I must state that you do not read my communication diligently (cf. 2.) and you do not answer my question with regards to yours and Bobby’s instructions which I try to follow. |
January 11, 2025 at 6:54 pm #16584632 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
My apologies, it seems like Bobby and I did not capture the issue directly. The HFCM plugin is not fully compatible with WPML. The problem is the display condition for specific pages, as each page has a different ID and this is why the code is not showing up on the translated pages. Example: To fix this issue compatibility code WPML would need to be implemented into this plugin. I can offer to find a solution for this issue and escalate the problem to the compatibility team for further revision. Alternative: Try a different plugin like "Code Snippets" or "WP Code". |
January 11, 2025 at 7:11 pm #16584640 | |
alexZ-17 |
Better late than never - thank you! Where and how should be the tag added - manually in HTML? - please elaborate! B (you) If HFCM would work properly which field would be expected? Basically, it is about where, how and if I can edit a translated page – WP editor or only WPML advance editor PS I will try the plugins advised by you |
January 11, 2025 at 7:41 pm #16584701 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
WORKAROUND: In the file \wp-content\plugins\header-footer-code-manager\includes\hfcm-add-edit.php on line 206 replace the SELECT element with this version: <select name="data[s_pages][]" multiple> <?php foreach ( $nnr_hfcm_pages as $pdata ) { if ( class_exists( 'sitepress' ) ) { // WPML is active, fetch translations $translations = apply_filters( 'wpml_get_element_translations', null, $pdata->ID, 'post_page' ); // Loop through each translation and display it in the select field foreach ( $translations as $lang_code => $translation ) { $lang_name = isset($translation->language_name) ? $translation->language_name : ''; // Get language name (optional) $selected = in_array( $pdata->ID, $s_pages ) ? 'selected="selected"' : ''; // Check if page is selected printf( '<option value="%1$s" %2$s>%3$s (%4$s)</option>', esc_attr( $translation->element_id ), esc_attr( $selected ), esc_html( $translation->post_title ), esc_html( $lang_code ) // Display language code or language name ); } } else { // WPML is not active, use the default logic $selected = in_array( $pdata->ID, $s_pages ) ? 'selected="selected"' : ''; // Check if page is selected printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $pdata->ID ), esc_attr( $selected ), esc_html( $pdata->post_title ) ); } } ?> </select> This way the select field will display all pages including their language code and you will be able to set display conditions for pages in different languages. Take note, that other display condition fields of the plugin need similar implementations to be able to work with WPML. I will be escalating the issue now to the compatibility team for further revision, but please take note that it requires the cooperation of the author from HFCM to make it possible for the plugin will work with WPML. As this plugin offers a PRO it is very likely that if the author considers implementing compatibility code for WPML, then this will likely only be the case for the PRO version of the plugin. I suggest you reach out to the author on wordpress.org and invite the author to join our Go Global program so that we can assist in making the plugin compatible with WPML. Our compatibility and partnership team might try to obtain the cooperation of the author as well. WPML Go Global: |