Hreflang setup for English and Arabic websites using en-AE, ar-AE and x-default with return links

Hreflang for English and Arabic Websites: A Practical Setup Guide

Hreflang tells Google which language or regional version of a page to show each searcher. On a bilingual UAE website, it links each English page to its Arabic equivalent, so Arabic searchers see the Arabic page and English searchers see the English one. Set it up correctly and both versions can rank in the right searches. Get it wrong and Google may show the wrong language, or simply ignore the tags.

This guide covers the codes, the rules Google actually enforces, how to set it up on WordPress and Shopify, and the mistakes we see most often on Arabic websites.

What hreflang does (and doesn’t do)

Hreflang is a signal, not a command. It helps Google choose between versions of the same content that already exist and are indexed. It doesn’t:

  • translate anything,
  • get a page indexed that otherwise wouldn’t be,
  • make an Arabic page rank if the content is weak or poorly targeted.

It’s most useful when you have equivalent pages in two or more languages, such as /services/seo/ and /ar/services/seo/.

The codes: language first, region optional

An hreflang value is a language code (ISO 639-1), optionally followed by a region code (ISO 3166-1 alpha-2):

ValueMeaning
arArabic, any region
enEnglish, any region
ar-AEArabic, for users in the UAE
en-AEEnglish, for users in the UAE
ar-SAArabic, for users in Saudi Arabia
x-defaultFallback for users who don’t match any other version

Rules worth remembering:

  • The language comes first. ar-AE is valid. AE-ar and ae on its own are not (ae isn’t a language code).
  • There’s no code for a city. “Dubai” or “Abu Dhabi” can’t be used.
  • A region alone isn’t allowed. You always need the language.

Should you use ar or ar-AE?

If your Arabic pages are meant for Arabic speakers anywhere, use ar and en. If you have different versions for different countries, for example UAE pages with AED prices and Saudi pages with SAR prices, use region codes such as ar-AE and ar-SA. A common, safe set-up for a business serving only the UAE is en-AE + ar-AE + x-default. Adding plain en and ar as well catches speakers in other countries.

What matters most is consistency: use the same codes on every page.

The three rules Google enforces

  1. Return links (reciprocity). If the English page points to the Arabic page, the Arabic page must point back to the English page. Without the return link, Google may ignore the tags.
  2. Self-reference. Each page lists itself as well as its alternates.
  3. Canonical URLs only. Hreflang should point to indexable, canonical URLs, not to redirected pages, noindex pages or URLs with tracking parameters. Each language version should have a self-referencing canonical. Don’t canonicalise the Arabic page to the English one.

Example: a two-language service page

On both the English and Arabic page, in the <head>:

<link rel="alternate" hreflang="en-AE" href="https://example.ae/services/seo/" />
<link rel="alternate" hreflang="ar-AE" href="https://example.ae/ar/services/seo/" />
<link rel="alternate" hreflang="x-default" href="https://example.ae/services/seo/" />

Both pages carry the same set of tags. That covers self-reference and return links in one go.

Hreflang can also go in the XML sitemap or in HTTP headers (useful for PDFs). Pick one method and use it consistently.

Choosing the URL structure

StructureExampleNotes
Subfolderexample.ae/ar/Easiest to manage; authority stays on one domain. The usual recommendation
Subdomainar.example.aeWorks, but is managed more like a separate site
Separate domainsexample.ae / example.saStrongest country signal; the most work to build and maintain
Parameters?lang=arNot recommended

Avoid switching language automatically based on the visitor’s IP or browser. Google mostly crawls from US IP addresses and could end up seeing only one version. Let users choose, with a visible language switcher that links to the equivalent page, not the homepage.

Setting it up on WordPress

  • WPML and Polylang generate hreflang tags automatically when pages are linked as translations.
  • Make sure every English page is actually linked to its Arabic translation in the plugin. Unlinked pages get no hreflang.
  • Check that your SEO plugin and the multilingual plugin don’t both output tags.
  • Set x-default to your main language, which is usually English.

Setting it up on Shopify

Shopify Markets creates language and country versions (for example /ar-ae/) and adds hreflang automatically once languages are published. Your job is to make sure the Arabic content is genuinely translated and published, not left half in English. See our Shopify SEO checklist for the full set-up.

Hreflang works best with real localisation

Hreflang only decides which version Google shows. The Arabic version still has to deserve to rank:

  • Arabic keyword research done separately (see our guide to Arabic keyword research)
  • Arabic titles, meta descriptions, headings and image alt text
  • Right-to-left layout that works on mobile
  • Arabic URL slugs, or clean transliterated ones

Common hreflang errors on Arabic websites

ErrorFix
Arabic page doesn’t link back to the English oneAdd reciprocal tags on both pages
hreflang="ae" or hreflang="ar-UAE"Use ar-AE
Arabic page canonicalised to the English pageSelf-referencing canonical on each version
Hreflang pointing to redirected or 404 URLsPoint to final, live URLs
Language switcher links to the Arabic homepageLink to the equivalent Arabic page
Half-translated Arabic pagesTranslate fully before publishing
Tags added only to the homepageAdd them to every page that has a translation

How to check your hreflang

  • View the page source and search for hreflang.
  • Crawl the site with an SEO crawler that reports missing return links and invalid codes.
  • In Search Console, filter Performance by country and query language patterns to see whether Arabic pages are appearing for Arabic searches.

Frequently asked questions

Do I need hreflang if my Arabic and English pages are completely different?

Hreflang is for equivalent pages. If a page exists in only one language, it doesn’t need hreflang. Pages that have equivalents still do.

Does Google use the lang attribute to work out the language?

Google says it determines language from the visible content, not from the HTML lang attribute. Still set lang="ar" and dir="rtl" on Arabic pages, because browsers and screen readers rely on them.

Can I target Saudi Arabia from a UAE website?

Yes. Create Saudi-specific pages where the content genuinely differs (prices, locations, regulations) and tag them ar-SA or en-SA. If the content is identical for both countries, plain ar is enough.

Need hreflang set up properly?

We set up bilingual English and Arabic websites, from keyword research to hreflang and RTL testing. See our Arabic SEO services in Dubai and why multilingual SEO matters in GCC markets, or request a free audit on +971 56 568 3130.