Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is experiencing an issue where switching to the Spanish language on their website redirects them to the homepage instead of the translated Activity page. They have set up WPML and translated a custom post type (CPT) 'Cooking Classes' but encounter redirection and 'Invalid post type' errors.
Solution:
We recommend the following steps to troubleshoot and resolve the issue:
Ensure that the custom post type 'Tours' is properly configured for translation in WPML. Go to ACF > POST TYPES > TOURS > EDIT, select WPML translation Editor, and click the + sign to translate it.
If these steps do not resolve the issue or if you encounter further problems, it might be due to outdated information or a different configuration. 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 WPML support forum for further assistance.

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.

This topic contains 15 replies, has 3 voices.

Last updated by Andreas W. 5 months, 2 weeks ago.

Assisted by: Andreas W..

Author Posts
June 13, 2024 at 6:18 pm #15737576

odisseasK

Background of the issue:
I have a website built in DIVI THEME with DIVI Builder. I installed the following plugins: Yoast SEO, WPML core plugin, WPML Translation Management, WPML String Translation add-on, WPML SEO add-on. I have created 3 custom post types - Activities, Tours, Accommodations. I am trying to translate one Activity to see if it is working correctly. After I installed the plugins, I took the following steps to translate one specific Activity 'Cooking Classes': 1. SETUP WPML 2. WPML > Languages - set up site language, translation languages, menu switcher locations 3. WPML > Settings > Εnableδ translatable items 4. WPML → Translation Management and scrolled down to Select activity for translation. 5. translation Que (WPML > Translations) and translated the content.

Symptoms:
When I go to hidden link and switch to Spanish Language, it redirects me to the Homepage.

Questions:
Why does switching to the Spanish language redirect me to the homepage instead of the translated Activity page?
Is there a step I missed in the translation process for custom post types in WPML?

June 13, 2024 at 6:37 pm #15737608

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting WPML support. While you are waiting for one of my colleagues to take this ticket and work on it, let me provide you with first debugging steps or if I can perhaps help with the issue quickly.

Please make sure that in WPML > Settings your custom post types are marked as translatable.
https://wpml.org/documentation/getting-started-guide/translating-custom-posts/

Besides that,I checked your debug info and noticed that your website doesn't have the minimum memory required for WPML to work. WPML requires a memory limit of at least 128MB while 256MB is recommended. See https://wpml.org/home/minimum-requirements/ for detailed information. You can set WP Memory Limit in your wp-config.php file by adding the following code:

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

See:

https://wordpress.org/support/article/editing-wp-config-php/#increasing-memory-allocated-to-php

for details. Increasing WP Memory may help improve the performance and sometimes also help resolving such issues.

If that does not help, one of my colleagues will soon come to continue support.

June 13, 2024 at 7:20 pm #15737663

odisseasK

Thanks Lucas for your support.

I had already set the limits to 128 but now I changed it to 256.

Please let me know if you still see the error

Screenshot 2024-06-13 221855.jpg
Screenshot 2024-06-13 221914.jpg
June 13, 2024 at 9:04 pm #15737816

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

If you revise the Spanish menu, it actually seems as if those contents were not yet published.

Please revise the status of your translated content.

It may happen that translations are saved as draft, if at the moment that you began translating the content the original content was still saved as draft.

Also, in case you use "Translate Everything Automatically" by default the translations are saved as a draft. You will need to complete a review at WPML > Translations first before they get published. This can be altered for new translations using the options on WPML > Settings > Automatic Translation.

Best regards
Andreas

June 14, 2024 at 9:35 am #15739412

odisseasK

Hello Andreas.

I translate everything myself.

I translated a custom post type instance.
I visited the english version on the website, clicked the spanish flag and got redirected to the home page

blue sky translation.jpg
blue sky english.jpg
blue sky spanish home redirection.jpg
June 14, 2024 at 6:42 pm #15741135

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I would like to offer to have a closer look at the problem and request temporary access (wp-admin and FTP) to the website to investigate this issue further.

You can find the required fields below the comment section when you log in to leave the next reply. The information you provide is private, which means only you and I can see and access it.

IMPORTANT
Please be sure to make a backup copy of the website and database before allowing us access.
If you can't see the wp-admin / FTP fields, your post and website credentials are set as PUBLIC. DO NOT publish the data unless you see the required wp-admin / FTP fields.

The private response form looks like this:
hidden link

Next time you reply, click "I still need assistance."

Video:
hidden link

Please note that we are obliged to request this information individually on each ticket. We may not access any access information not specifically submitted on this ticket in the private response form.

Best regards
Andreas

June 15, 2024 at 9:43 am #15741576

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

If I switch to the translated CPT on the list view or the WordPress Editor, I get the message "Invalid post type".

Is it possible to temporarily disable plugins on this install and maybe even switch the theme for testing purposes?

June 15, 2024 at 12:50 pm #15741727

odisseasK

I have only translated two post types in the website.

The first one is this ( STAY > Blue Sky Cave house Oia )

hidden link

The other one is this (ENJOY > Cooking Classes )

hidden link

If you visit those two instances in English version and HOVER over the Spanish Flag, you see at the bottom left that the link is the correct one.

But when you CLICK on the Spanish flag on
hidden link
you get redirected to the HOME PAGE

And when you CLICK on the Spanish flag on
hidden link

is tells you that there are no results for this page.

YES you can disable plugins or switch themes. This is a testing website. Thank you for your support

June 15, 2024 at 6:29 pm #15741994

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

On ACF > Post Type click "Edit" and then translate the post type.

I did this already for "Activities" now:
hidden link

Unrelated to the issue:
The ACF Field Group Post Type should always be set to "Not translatable".

June 16, 2024 at 8:02 pm #15743034

odisseasK

Can you please explain exactly what you did ?

The spanish translation doesn't appear as it should.
The post type is assigned to a Divi Theme Builder Layout.
Why doesn't the Spanish version render the layout as well?:

June 16, 2024 at 8:03 pm #15743035

odisseasK

Also pay attention to the footer in Spanish. It is broken

June 17, 2024 at 9:56 am #15744448
odisseasK

I deleted some Divi Theme Builder layouts and I received a critical error coming from WPML SEO Multilingual.

Maybe it is related to the issue we are discussing?

New threads created by Andreas W. and linked to this one are listed below:

https://wpml.org/forums/topic/split-issue-translating-divi-theme-builder-layouts/

Screenshot 2024-06-15 121449 (1).jpg
June 18, 2024 at 4:30 pm #15750265

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I went to On ACF > Post Type clicked the "Edit" option on the post and then used the UI to create the translation for the post type.

This solves the main issue of this ticket about CPTs not showing up in the second language.

Let me know if you still have questions about this as this is not yet covered by our documentation.

We only released the following post about it:
https://wpml.org/compatibility/2024/04/acfml-2-1-0-translate-labels-for-acf-custom-posts-taxonomies-options-pages/

Regarding your last two comments, take note that this is a different issue and we only handle one issue per ticket. I am splitting this new issue about Divi Templates into a new ticket and will follow up there with you shortly.

You will receive an e-mail notification once I reply to the new ticket.

Best regards
Andreas

June 18, 2024 at 4:58 pm #15750387

odisseasK

So if I want to repeat what you did for the Activities ( ex. the TOURS ) , I go to ACF > POST TYPES > go to TOURS > EDIT > select WPML translation Editor and click the + sign to translate it?

Screenshot 2024-06-18 195611.jpg
June 18, 2024 at 4:59 pm #15750402

odisseasK

Thanks for your feedback on Divi Layouts. I will wait for your new ticket.
Please have in mind that I want the Spanish translation on every post to be assigned to the same template assigned to the English one...and I also want to change the button links on the Spanish version.