Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter leandros21

    (@leandros21)

    The problem is solved by deleting the below function and add any desirable metas to the head.

    // set links to translations of current page
    	foreach($q_config['enabled_languages'] as $lang) {
    		if(!empty($q_config['locale_html'][$lang])){
    			$hreflang = $q_config['locale_html'][$lang];
    		}else{
    			$hreflang = $lang;
    		}
    		//if($language != qtranxf_getLanguage())//standard requires them all
    		echo '<link hreflang="'.$hreflang.'" href="'.qtranxf_convertURL('',$lang,false,true).'" rel="alternate" />'.PHP_EOL;
    	}
    	//https://support.google.com/webmasters/answer/189077
    	echo '<link hreflang="x-default" href="'.qtranxf_convertURL('',$q_config['default_language']).'" rel="alternate" />'.PHP_EOL;
    Plugin Author John Clause

    (@johnclause)

    The source of your page shows:

    <!– BEGIN Metadata added by the Add-Meta-Tags WordPress plugin –>
    <link rel=”alternate” hreflang=”en” href=”http://www.marketingcy.com/&#8221; />
    <!– END Metadata added by the Add-Meta-Tags WordPress plugin –>

    I guess it is a question to “Add-Meta-Tags WordPress plugin”. You should not need to modify the code, all should be ok through options.

    What exactly is wrong?

    Thread Starter leandros21

    (@leandros21)

    The actual problem is that you have greek twice,
    one “gr” and an other one “el”. “gr” is location and “el” is language
    so i modified the code and add the most appropriate hreflangs
    as you can see in my website now.

    PS: At the beginning, when i developed the website i chose “gr” for greek so the hreflangs were for Greece but outside Greece there are some millions greek speakers :p

    Plugin Author John Clause

    (@johnclause)

    I do not understand the problem. Could you show me all hreflang entries which you think are wrong? How would you have two gr and el, if there is one language only for greek in configuration, is there?

    There is also option “Locale at front-end”, which should allow you to control which locale to show at front-end for each language. Show me the error message you were getting as well as all actual lines “<link hreflang=” that it was complaining about.

    Currently, you may not getting error messages, but the way it is done is definitely wrong for multilanguage site.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hreflang issue’ is closed to new replies.