• Resolved smorrisrosenstein

    (@smorrisrosenstein)


    Hi! I have just started using the plugin and am having problems with setting hreflang correctly.

    I have created international variants of the languages I need by overwriting unused languages in the list and with EN, IT, ES, and FR I haven’t had any problems, but when I create the Portuguese site it defaults to “pt-BR” instead of just “pt”. This is what the code looks like:

    <link rel="alternate" hreflang="en" href="https://www.visitcampnou.com/"><link rel="alternate" hreflang="es" href="https://www.visitcampnou.com/es/"><link rel="alternate" hreflang="it" href="https://www.visitcampnou.com/it/"><link rel="alternate" hreflang="fr" href="https://www.visitcampnou.com/fr/"><strong><link rel="alternate" hreflang="pt-BR" href="https://www.visitcampnou.com/pt/"></strong><style type="text/css" media="print">#wpadminbar { display:none; }</style>

    This is how the languages are set up: https://imgur.com/2eKPkUs

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    seems like you did a good job in setting up your custom language variants.

    For Portuguese, I can only assume that you mistakenly chose the wong language, and not Portuguese (Int)…?

    Can you double-check?
    You can also have a look at the value in the <select> element in your browser’s developer tools or so.

    Cheers,
    Thorsten

    PS: One unrelated thing: why did you set all the languages to be RTL (right-to-left), when they’re clearly not? Did you maybe forget to uncheck that from the languages you customized?

    Thread Starter smorrisrosenstein

    (@smorrisrosenstein)

    Thanks for the quick reply!

    I double checked and it wasn’t a mistake in language selection. I actually deleted and re-created the new page a couple of times to test this and the error persisted. I’ll see if the error repeats with other languages and get back to you if it does.

    In the meantime, I’ve found a (somewhat hacky) solution: I changed the regional variants “pt-PT” and “pt-BR” to “pt”. We’re not planning on doing regional targeting so losing these two variants is not a problem for now, and I can always restore to default if needed.

    On RTL, you’re correct. I ticked all the new languages to mark them and forgot to undo it.

    Hm, good that you found a workaround. But still, this is strange.
    Could you export the languages table, wp_mlp_languages (there shouldn’t be any sensible data in there) and send the DB dump (of that table) to [email protected], or upload it somewhere and provide a link here? Also, could you paste what’s inside the site languages option (see code)?

    SELECT meta_value FROM wp_sitemeta WHERE meta_key = 'inpsyde_multilingual';

    Please adapt yout table prefix, wp_, if necessary.

    Thanks in advance!

    Cheers,
    Thorsten

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hreflang defaults to regional language code’ is closed to new replies.