Skip Navigation

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

Last updated by jonathanF-3 8 months, 3 weeks ago.

Assigned support staff: Riffaz.

Author Posts
September 17, 2020 at 2:22 am #7031781

jonathanF-3

Hi! We know that WPML already manage Hreflang for Google, however hreflang isn't supported by BING.

We are wondering how we can insert the proper <meta http-equiv="content-language" content=" "> meta data in a multilingual site created with WPML ?

This should be inserted in the <head> just like the hreflang.

Question:
1) Does WPML support this ?
2) If not, is there a way we can simply inject the metadata in the page header based on the page language ?

September 17, 2020 at 3:46 am #7032203

Riffaz

Hi,

Thank you for contacting WPML support.

There is no option to do that for now.
Anyhow, you can do this using simple PHP function.
Add this to the bottom of your functions.php

function add_bing_meta() { 
if(ICL_LANGUAGE_CODE=='en'){ 
    echo '<meta http-equiv="content-language" content=" English content ">';
    }
    else {
        echo '<meta http-equiv="content-language" content=" other language content ">';
    }
}
add_action( 'wp_head', 'add_bing_meta' );

Change these lines as you want

<meta http-equiv="content-language" content=" English content ">
<meta http-equiv="content-language" content=" other language content ">

I tested this in a fresh site and it works as expected.

It would be a cool feature though.
Would you mid sending a feature request for this? https://wpml.org/suggest-a-new-feature-for-wpml/

Regards,
Riffaz.

September 21, 2020 at 12:29 pm #7059639

jonathanF-3

Great, working as expected. Submitted a feature request! 🙂