Saltar navegación

Este hilo está resuelto. Aquí tienes una descripción del problema y la solución.

Problem:
The client is testing WPML on a new site with both Yoast and WPML SEO plugins installed but is facing an issue where the canonical tag is not being created automatically.
Solution:
If you're experiencing issues with canonical tags not being automatically created, it's important to note that with Yoast SEO active, all SEO data, including canonical tags, are managed by Yoast SEO. However, if Yoast SEO is not in use, WPML should handle this. Since Yoast SEO is active on your site, canonical data should automatically be added when you create a post or page. If there are issues with canonical tags on translations, ensure that the WPML SEO plugin is activated. Start by activating the WPML SEO plugin, then run the Yoast SEO optimization and check again. Create a new page, translate it, and verify if the canonical URLs are displaying correctly.

In cases where a post or page in another language isn’t connected to the default language version, it won’t have the x-default value. We are aware of this and have taken it as a feature request. Meanwhile, you can use a code workaround suggested in our forum: https://wpml.org/forums/topic/hreflang-x-default-is-missing-from-some-pages-2/#post-11625629

If this solution does not resolve your issue or seems irrelevant due to being 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 further assistance is needed, please open a new support ticket at WPML support forum.

Este es el foro de soporte técnico de WPML, el plugin multilingüe de WordPress.

Todas las personas pueden leerlo pero solo los clientes de WPML pueden ingresar comentarios. El equipo de WPML responde en los foros 6 días a la semana, 22 horas por día.

Este tema contiene 3 respuestas, tiene 0 voces.

Última actualización por alfredoR hace 1 mes.

Asistido por: Prosenjit Barman.

Autor Entradas
noviembre 13, 2024 en 6:37 pm #16398352

alfredoR

Background of the issue:
I'm testing WPML on a new site called 'Sitio en desarrollo'. I have both Yoast and WPML SEO plugin installed.

Symptoms:
Canonical tag is not being created automatically.

Questions:
Please could you confirm if WPML should be creating the canonical tag?
If WPML should create the canonical tag, am I missing some configuration?
If WPML does not create the canonical tag, can you give any advice about how to get the canonical tag on my pages?

noviembre 14, 2024 en 6:49 am #16400770

Prosenjit Barman
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

I understand your concerns. Please note that with Yoast SEO active, all SEO data—such as canonical tags, sitemaps, and Open Graph data — will be managed entirely by Yoast SEO. However, if you’re not using the Yoast SEO plugin, then WPML will handle canonical tags and other essential data in the Head tag.

Since Yoast SEO is active on your site, canonical data should automatically be added when you create a post or page. If you’re experiencing canonical issues on translations, it might be due to the WPML SEO plugin not being activated. According to the WPML debug info, the WPML SEO plugin appears to be deactivated.

Please start by activating the WPML SEO plugin. After that, run the Yoast SEO optimization and check again. You can also create a new page, translate it into the other language, and then verify if the canonical URLs are displaying correctly.

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

Best regards,
Prosenjit

noviembre 14, 2024 en 11:00 am #16401782

alfredoR

Finally the problem was that this is a testing site and WP was configured to block robots, so noindex was set on all pages, and Yoast doesn't add canonical tag for pages with noindex.

Now I'm struggling to set up hreflang x-default correctly:

EN is the default language for this site.

1. For any post in any language that has an EN version, I would like to set x-default with the EN version for all languages.

2. For any post in any language that hasn't an EN version, I would like to set x-default with homepage in the default language (EN).

Apparently the default behaviour is that, in there isn't a version in EN, x-default is not set for the rest of languages.

Any idea?

noviembre 15, 2024 en 3:42 am #16405595

Prosenjit Barman
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Dhaka (GMT+06:00)

Hello There!
Thank you for the update.

I'm glad you've identified the cause of the canonical not updating correctly.

In response to your other query: when a post or page in another language isn’t connected to the default language version, it won’t have the x-default value.

However, we’re aware of this scenario and have taken it as a feature request to set the default homepage or page link as x-default. In the meantime, we’ve suggested a code workaround in the response below. Please follow the suggestion, and I hope it will be helpful.

- https://wpml.org/forums/topic/hreflang-x-default-is-missing-from-some-pages-2/#post-11625629

Feel free to mlet me knnow if you have need further assistance or clarification. I'll be happy to help.

Best regards,
Prosenjit

noviembre 18, 2024 en 8:09 am #16413210

alfredoR

Thanks, I'll try your code.