IP geolocation can resolve it?


Maybe I could get help here.
I have a wordpress site (it’s a social network) with OpenLiteSpeed ​​system, my server is in germany and my dns are managed entirely by Cloudflare (it’s also my registrar).
I have a problem that I cannot solve.
When the user posts a url, it will generate a preview in the news feed. Since my site is in Italy with an Italian audience, I would expect the language to be in Italian, instead it is sometimes German, sometimes Turkish, and lately also Chinese.
I was told that the problem lies in the location of the server (germany).
Now, sifting through the countless Cloudflare functions, I noticed the existence of the “ip geolocation” function which is already active but the result I have is the hanging one explained.
Could this function (I saw that there are associated snippets but that I don’t know how to apply honestly), help me in returning the Italian language to the screen for these previews?

I hope someone can help me


Claudio Z.

I might be wrong, but there could be a case like:

  1. Visitor could have his OS set on one language
  2. Web browser on second
  3. Therefore be in a third country

Regarding the above example case, may I ask what kind of WordPress multilanguage plugin are you using and how does it determine the visitor/user which conten language to show to him?
By the IP address of the network connection (what if he/she is using a VPN too?), or accepted web browser language(s) - which also could be multiple, if so.

Furthermore, have you implemented an solution to return and see true visitor IP address in your access & error log files as the suggested steps from link below:

Hello and thank you for reply.

I can tell you that I do the tests myself directly from Italy (the website is online but not officially live yet).
The browser is set to the Italian language.

I add that the header of the site set is correct (if I check with the dev tools I can clearly see that the language the borwser refers to is and in fact ITalia (IT), that’s why I’m asking here too because I can’t understand this thing.

Having seen the geolocation function of Cloudflare, I thought it was possible to insert a PHP snippet that would refer the current IP of the German-based server to the Italian IP.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.