Paste this into your theme’s functions.php file to prevent from Hreflang tags to appear on the same current language and fix duplicates.

add_filter('wpml_hreflangs', 'wpml_fix_duplicate_hreflangs', 10, 1);
function wpml_fix_duplicate_hreflangs($hreflang_items){
	foreach ($hreflang_items as $key => $item)
		if (substr($key,0,2)==ICL_LANGUAGE_CODE)
	return $hreflang_items;

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?