How to add country suffix to the hreflang tags? I am working on a multilingual site. In which I am using Alternate hreflang module and everything working as expected.



But it should look like

    &lt;link href="/es" rel="alternate" hreflang="es-ES" /&gt;
   &lt;link href="/es" rel="alternate" hreflang="es-MX" /&gt;
    &lt;link href="/es" rel="alternate" hreflang="es-AR" /&gt;


Means in hreflang need to add country name as suffix like es-ES, es-MX etc.

Tried like below but its not working.
This cannot be achieved in the Alternate Hreflang module or any other Drupal module. They all use the language code as the hreflang code which is incorrect as hreflang contains 2 parts - the language "es" and the country "ES" (Spanish, Spain) or in your example es-MX (Spanish, Mexico).

I've had three or four contributors (metatag, Alternate Hreflang) come back to me and state that you need to create custom languages for this to actually work. So for Mexico create a new language and use the code es-MX then this will show the appropriate hreflang code es-MX. However it will 
a) create an unnecessary language
b) probably require Language Hierarchy to avoid superflouous translations
c) also show in the URL as es-MX which in my opinion is also not ideal (the MX is in UPPERCASE and the URL will always be flattened to lowercase on output not ideal for SEO or asthetics...)

Off the shelf them's your options me thinks. 

I would suggest coding some simple patch to the Alternate Hreflang module to include the ISO list of country codes so through a UI you could add whatever country you liked alongside the any enabled language into the hreflang code.