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 4 replies, has 2 voices.

Last updated by Dat Hoang 4 years, 4 months ago.

Assigned support staff: Dat Hoang.

Author Posts
February 17, 2016 at 10:19 am #815137

Sergio

Hello, this question is for sites set up to "Redirect visitors based on browser language only if translations exist".

Is WPML handling users redirecting to the right location with a meta refresh? If not, how?
Maybe a 302 is used?

How is WPML treating Googlebot? Do robots see and behave the same way as browsers, or the redirects work in a different way for Googlebot?

February 18, 2016 at 7:33 am #815994

Dat Hoang

We use JavaScript for this purpose.
You can see more at: https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/

How is WPML treating Googlebot? Do robots see and behave the same way as browsers, or the redirects work in a different way for Googlebot?

Actually there was no issue in the past because Googlebot could not execute JavaScipt. But this has been changed, Googlebot is now smart enough to run JavaScript also.
Please see the document above, we have a section discussing about this change as well.

February 18, 2016 at 9:22 am #816180

Sergio

I started this discussion because for some strange reason my English site is indexed in google.pl / Polish. And it appears in the search results searching for polish keywords, which are not in the English site at all....

Can you help somehow?

February 18, 2016 at 12:34 pm #816518

Sergio

I also received a reply from GWF hidden link:

================================
You should ensure that Google can access each of your public canonical URLs without relying on JavaScript and without redirection.

Presumably you want hidden link to be shown as the US home page and hidden link as the home page for Poland.

THere are several anomalies with your configuration and they may combine to create suboptimal indexing and search results.

For example:

--- is hidden link actually indexed by Google? I cannot see it in the usual place, but have not inspected all results. But if it is not indexed (regardless of the reason) it is not going to show in search results;

--- hidden link is specified in your hreflang annotation but NOT in your menu and site navigation. You have omitted the final slash and your server has to 301 redirect from the URL given in the navigation and send to the correct URL. You can see this in your browser if you look very carefully or you can use a test tool such as web-sniffer.net.

--- in your hreflang annotation you have specified hreflang="pl-PL", ie you are restricting to Poland; as you have only one Polish version of each page, it might be better to specify hreflang="pl" ie for Polish users everywhere (eg Donald Tusk in Brussels! 🙂 )

--- similarly, you specified hreflang="en-US" but you don't have an equivalent alternative for English speakers outside the US, eg in Britain or Germany or Russia. If you have only one English version of the particular page, I'd recommend using hreflang="en" (ie for English speakers everywhere).

================================

Can you please help to resolve those issues?

February 19, 2016 at 1:05 am #817719

Dat Hoang

Based on the information you gave above, WPML is handling correctly.

You should ensure that Google can access each of your public canonical URLs without relying on JavaScript and without redirection.

Without JavaScript, for sure, Google bots can access all your sites normally.

Please read this document https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/how-browser-language-redirect-affects-google-indexing/

We said:

If you see the 'wrong' languages in Google index, consider disabling the browser language redirection.

I suggest you should try to disable this and see how the situation is changed.