Skip Navigation

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 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 -

Supporter timezone: Asia/Dhaka (GMT+06:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Prosenjit Barman 1 year, 1 month ago.

Assisted by: Prosenjit Barman.

Author Posts
November 8, 2023 at 7:33 pm #14760899

Daniel Dorado

I am trying to:

Switch pages that are translated

Link to a page where the issue can be seen:

hidden link

I expected to see:

Instead, I got:

When i swap two times the lang with the language swticher second time in english retrieves a 404

Also other pages that have a parent page set retrieve a 404

November 9, 2023 at 4:17 am #14762039

Daniel Dorado

https://wpml.org/forums/topic/duplicating-a-page-and-switching-its-language/

This is exactly what it's happening

November 9, 2023 at 4:38 pm #14770045

Daniel Dorado

at the moment i had the plugin object cache pro deactivated and it's working but definitely that is not a option as it is a huge benefit having it installed and active with lz4 compression and igbianry to work with redis + relay

November 10, 2023 at 10:19 am #14774969

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for reaching out to us.

I understand the issue you're having and will try my best to assist you in this matter.

We've recently identified some issues with WPML that only arise when the Object cache is enabled on the site. For detailed information, please check the Errata below.

- https://wpml.org/errata/object-cache-pro-various-issues/

Could you please install the plugin suggested in the Errata and see if it resolves the issue?

- Back up the site completely first to prevent any issues.
- Go to the "/wp-content/" folder on the site and create a folder named 'mu-plugins' if there is not one already.
- Inside the 'mu-plugins' folder upload this PHP file: hidden link
- Once done, enable the Object Cache plugin and clear the caches from there.

After setting up the plugin properly, it would be beneficial to refresh the permalink structure. You can do this by navigating to "Settings > Permalinks" from your dashboard and clicking on "Save changes." This step often helps to ensure the changes take effect correctly.

Please let me know if this approach helps to solve the issue. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

November 10, 2023 at 10:46 am #14775421

Daniel Dorado

i already did that going even further

wp_cache_add_non_persistent_groups( [
'convert_url',
'element_translations',
'get_pages_adjust_ids',
'get_user_admin_language',
'translation_priority_relationships',
'translationmanagement--get_translation_job_id',
'wpml_cache_terms_per_lang',
'wpml_endpoints_support',
'wpml_pre_option_page',
'wpml_register_string_filter',
'wpml_register_string_filter--facetwp',
'wpml_slug_translation_records--post',
'wpml_slug_translation_records--taxonomy',
'wpml_st_cache',
'wpml_term_translation',
'wpml_tm_blog_translators--has_translators',
'wpml_wp_cache__group_keys',
'wpml_404_guess',
'wpml_name_query_filter_translated',
'wpml_page_name_query_filter',
'wpml_post_status--needs_update',
'wpml_slug_translation_records--post',
'wpml_st_cache',
'wpml_st_term_link_filter--replace_base_in_permalink_structure',
'wpml_tm_blog_translators--has_translators',
'wpml_tm_icl_translations--translations',
'wpml_wp_cache__group_keys',
] );

i was using object cache pro, where i also configured this, using wildcards.

'non_persistent_groups' => ['*icl*','wpml-string-shortcode','archive_query_has_posts','get_custom_html','icl_tax_permalink_filter','_process_generic_text','convert_url','element_language_details','original_element','element_trid','get_pages_adjust_ids','all_rewrite_rules','get_icl_translator_status','get_batch_data','translation_*','nav_menu_relationships','get_user_admin_language','ls_languages','WPML_*','sitepress_ms','wpml_*','wpml_404_guess','wpml_name_query_filter_translated','wpml_page_name_query_filter','wpml_post_status--needs_update','wpml_slug_translation_records--post','wpml_st_cache','wpml_st_term_link_filter--replace_base_in_permalink_structure','wpml_tm_blog_translators--has_translators','wpml_tm_icl_translations--translations','wpml_wp_cache__group_keys'],

Apparently there's an issue with the slugs, changing the slug of the page starting from the beggining looks like solve the problem,

for example /en/end-to-end-services/ was giving us those issues, i changed to something like
/en/services-end-to-end/ and now it's working, looks like in the code is making a kind of partial match to identify or redirect and that gets cached somewhere that never flushes properly and the only way is to change the slug to prevent that match

using page atrributes to nest pages is giving also issues when translating

November 13, 2023 at 5:25 pm #14791329

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
I hope you're doing well. Sorry for the delay in responding due to the Weekend.

Thank you for the update. It appears that the Object caching configuration is set up properly. However, I would like to point out that using the same slugs for different pages/posts might also be the reason behind the issue you're experiencing. Could you please verify that the same slug has not been assigned to any other post or page within a specific language?

If it is, then please change the slug of those pages and posts, clear the caches, and check again.

Please let me know the update. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

The topic ‘[Closed] odd 404 when using language switcher with object cache pro’ is closed to new replies.