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.

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by Prosenjit Barman 1 year, 5 months ago.

Assisted by: Prosenjit Barman.

Author Posts
November 5, 2023 at 2:02 pm #14733131

henkt-2

The primary language is Dutch, but I execute a Site audit with Ahrefs I got al kinds of 301s due to references to other pages.

What I see is that it are pages that are only available in the primary language, these pages are not translated in a secondary language.

See the uploaded image, these are all pages in the primary language but have ../en/ extension as if it are pages in the secondary languae.

Can you help finding a solution?

Screenshot 2023-11-05 144237.png
November 6, 2023 at 10:05 am #14736267

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

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

Hello There,
Thanks for contacting WPML Support.

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

From the WPML Debug Info, I can see that the translation preference for the post and pages are currently set to "Translatable-use translation if available or fallback to default language"

With this configuration, any post or page that is not translated into a secondary language will still display in the secondary language. However, it will redirect users to the default language's post or page with a 301 status code, since the preference for the posts/pages is set to fallback to the default when no translation is present. This is the reason why the site audit results indicate redirection.

Would you please change the translation preference for the Page and Post to "Translatable-only show translated items" by going to the "WPML > Settings > Post Type Translations" section, and check if that helps to solve the issue?

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

Best Regards,
Prosenjit

November 7, 2023 at 9:10 am #14744951

henkt-2

Hi,

I changed the configuration as you requested.
But unfortunately the 301s are still there.

Do you have another suggestion to try?

Thanks, Henk

November 8, 2023 at 4:19 am #14752587

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

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

Hello Henk,
Thank you for the update.

I reviewed the page (hidden link) and noticed that after changing the language to English, the Dutch content still appears. This suggests that the setup wasn't correctly implemented. Could you please attempt the following steps and check if that helps to solve the issue?

Please follow these steps:

- Navigate to "WPML > Settings" and locate the "Post Type Translation" area.
- Ensure that the "Page" translation setting is "Translatable - only show translated items."
- Next, edit the 'ouderschapsplan' page in the WordPress Editor.
- Look for the "+" icon next to 'English' under the "Language" section on the right side of the editor. Click the icon and fully complete the English translation.
- After translating, clear your site's caches and check that the English version displays correctly on the front end.
- Then, run the Site Audit tool again to see if 'hidden link' still shows a 301 redirect.
- If the redirect is resolved, continue to translate the remaining pages in the same manner.

If the issue persists even after that, kindly share the site audit report that contains the redirection information in your next message. Additionally, if Ahrefs allows for the creation of a shareable link, please include the link for further examination.

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

Best regards,
Prosenjit

November 8, 2023 at 6:33 am #14752905

henkt-2

Hi Prosenjit,

Thank you for your detailed explanation.

I realize the following that I had not included in my first question. On the website, the main language is Dutch and the secondary language is English.

The intention is not to translate all pages into English, only a selection of them. The pages that are translated into English are only the ones that are relevant for people living in another country, for example.

For example, the Parenting Plan page from your example, it does not need to be translated into English. Dutch is sufficient for now.

Does this addition still help with the question?

Best regards,
Henk

November 8, 2023 at 7:55 am #14753207

henkt-2

Hi Prosenjit,

This is another request that sent to your support colleagues.
https://wpml.org/forums/topic/partial-translation-and-show-page-in-primary-language/

At that time, I fixed the menu, but the issue where we talk about now, is still relevant.

November 9, 2023 at 5:53 am #14762167

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

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

Hi Henk,
Thank you for your clarification.

If you choose to translate only select pages into English and prefer to display the original Dutch content when a translation isn't available, you can maintain the current translation settings. With these settings, a 301 redirect is expected. Since the English version of the page/post is not available, the WPML plugin will redirect the user to the Dutch version of the content (maintaining the correct URL Structure). This redirection detected by the site audit tool cannot be removed under these preferences.

However, if you do not want the Dutch content to display when an English translation is missing, and you wish to eliminate the 301 redirect, you should adjust the translation settings for pages and posts to "Translatable - only show translated content." This can be done through WPML > Settings > Post Type Translation. By doing so, the English page will only show content when a translation is available; otherwise, it won't load at all and WPML will also not try to redirect the user to default content. Thus the 301 redirects detected by the site audit tool will be removed.

Once the Translation preference is set to "Translatable - only show translated content", please try the following which will ensure that the WPML-related information propagated to the page and posts correctly.

- Take a backup of the site
- Please go to WPML > Support > Troubleshooting
- Click on the buttons marked in this screenshot: hidden link

I hope this explanation is clear. Once the Translation preference is set properly, rerun the site audit tool and hopefully, the 301 redirection will not appear there.

[If the Ahref Audit tool is configured to fetch site information from Google, the site audit may not display the result correctly if you run the tool immediately after making the changes. It will be better if you try after a few hours.]

Best regards,
Prosenjit

November 13, 2023 at 9:40 pm #14792561

henkt-2

Hi Prosenjit,

Thanks for your clear answer.
Tonight, I made all the changes you suggested.

Tomorrow, I'll test a few pages to see if it's working now.

Thanks for now,

Henk

November 13, 2023 at 9:51 pm #14792573

henkt-2

Hi Preosenjit,

After an initial test, I already have a question due to advancing insight (see also the attached screenshot).

Example:
See the page in the secondary language (English), see attached for the URL.
This page contains references to a Dutch page (see in the screenshot the red circle). Then the href to this page is still mixed: the URL says .../en/..., but the page in question is only available the primary language.
So the "/en" part in the URL is actually incorrect because the language is only available in the primary language.

How can I fix this?

Screenshot 2023-11-13 224342.png
November 14, 2023 at 8:13 pm #14802177

henkt-2

Hi,

If it's easier for you, I can provide you access to the site?

Please reach out to me if that can help.

Regards, Henk

November 15, 2023 at 3:44 am #14803773

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

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

Hi Henk,
I hope you're doing well.

If you're still using the "Translatable-use translation if available or fallback to default language" settings for the "Pages", the way it is appearing is expected. Since that particular child page hasn't been translated into English yet, the Dutch contents(along with the slug) are showing as Fallback. So, the way it is appearing now is expected.

If the Translation preference is set to show only translated content, the link should direct to the translated version exclusively. Otherwise, it should lead to the Dutch version, omitting the "en" code in the URL. In that case, here is what you've to do:

- Please make a small edit to the default page.
- Save the changes and update its translation.
- Once the translation is updated, check the English version of the page.

If the corresponding page with the link is translated, then the link should be updated with that translated version of the page. Otherwise, you'll see the default version without the language code in the URL.

Please let me know if that helps or if you need further assistance in this matter. I will be happy to help.

Best regards,
Prosenjit