• Hi,
    My names Jason.
    I’ve just started on a project which required translation into multiple languages (first time I have ever done this). And came across your plugin and thought it would be a brilliant solution. BUT I hit a road block.
    The digital manager of the project wants it to not only be language targeted but location/region targeted, in the tags the plugin generates as a example: <link rel=”alternate” href=”url” hreflang=”fr”> it specifies a language but not a location such as: <link rel=”alternate” href=”url” hreflang=”fr-be”> which they want it to do.
    I want to just simply know if there is away of doing this with your plugin before I spend more time on development. Or whether I need to find another solution.
    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chouby

    (@chouby)

    Hi,

    There is a filter pll_rel_hreflang_attributes allowing you to customize the hreflang to match your needs.

    Thread Starter jatkinson1

    (@jatkinson1)

    Hi Chouby,
    Thanks for this it helped. (sort off) I figured out how to use it to modify the hreflang. but now it adds my modified ones. But still keeps the original output to example:

    
    <link rel="alternate" href="#" hreflang="de-DE" />
    <link rel="alternate" href="#" hreflang="fr-FR" />
    <link rel="alternate" href="#" hreflang="es-ES" />
    <link rel="alternate" href="#" hreflang="it-IT" />
    <link rel="alternate" href="#" hreflang="en" />
    <link rel="alternate" href="#" hreflang="de" />
    <link rel="alternate" href="#" hreflang="fr" />
    <link rel="alternate" href="#" hreflang="es" />
    <link rel="alternate" href="#" hreflang="it" />
    

    Is there way of removing the original ones? as my digital manager says this wont work the way it is currently.

    Plugin Author Chouby

    (@chouby)

    The filter allows you to manipulate all hreflangs. So you can remove them too.

    Thread Starter jatkinson1

    (@jatkinson1)

    How do you mean? like this:

    remove_filter( 'pll_rel_hreflang_attributes', 'filter_pll_rel_hreflang_attributes', 10, 1 );

    Tried and didn’t work as expected.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘hreflang’ is closed to new replies.