The hreflang attribute in HTML is used to specify the language and optional region for a webpage, enabling search engines to serve the most appropriate version of a webpage to users based on their language and location. Below is a comprehensive list of standardised region codes commonly used with the hreflang attribute. These region codes […]
The hreflang attribute in HTML is used to specify the language and optional region for a webpage, enabling search engines to serve the most appropriate version of a webpage to users based on their language and location.
Below is a comprehensive list of standardised region codes commonly used with the hreflang attribute. These region codes adhere to the ISO 3166-1 alpha-2 standard for country codes, which are appended to language codes (e.g., en-US for English in the United States).
These codes can be combined with language codes (ISO 639-1) to create hreflang values such as en-GB (English for the UK), fr-FR (French for France), or es-MX (Spanish for Mexico).
John O'Connor is the founder and principal engineer of Web Lifter, a Brisbane software studio building custom software, AI systems, and structured data for Australian SMBs. He has spent over eight years shipping production AI and backend systems, and writes about what actually holds up once the demos are over. Everything published here is drawn from systems running in production for real clients.