RTL checker
Does your page declare that it is Arabic and reads right to left?
- Checks your page
- Reads:HTML
- 2 rules
- Last updated
What we keep
The result appears here
Enter your page’s address and press “Check the page”. This is what the tool runs on it:
- Arabic page without dir="rtl" on the html elementnot started
- Missing or wrong lang attribute on an Arabic pagenot started
What it checks
- The
<html>element hasdir="rtl"when most of the page's text is Arabic: notltrorauto, and not on<body>alone. - The
langattribute on<html>names a language written in Arabic script, such asarorar-SA, notenor an empty value.
Example
<!doctype html> <html lang="en"> <body> <p>مرحباً بكم في متجرنا</p> </body> </html>
<!doctype html> <html lang="ar" dir="rtl"> <body> <p>مرحباً بكم في متجرنا</p> </body> </html>
How to fix
Put the language and the direction together on the <html> element:
- In WordPress, choose Arabic under "Settings → General → Site Language"; themes that call
language_attributes()then add both attributes themselves. - If part of the page needs the other direction, such as a code sample or an English paragraph, put
dir="ltr"on that element only. - Add a country code when the content is meant for one country, such as
ar-SA,ar-AEorar-OM.
<html lang="ar" dir="rtl">FAQ
No. Direction is part of the meaning of the text, so it belongs in the HTML, as W3C and the HTML specification recommend. Styles may not load or may be ignored, as in a browser's reader mode or when the content is copied elsewhere; the attribute stays with the text.
Elements outside <body> do not inherit it, including <title>, which shows in the browser tab and in bookmarks. Put it on <html> and everything on the page inherits it.
Google says it determines a page's language from its visible content, not from the lang attribute. The attribute still matters: screen readers choose their pronunciation from it, browsers use it for fonts and translation offers, and WCAG 2.2 (success criterion 3.1.1) requires the page's language to be programmatically determined.
What this tool runs
- Arabic page without dir="rtl" on the html elementserious
rtl-html-dir - Missing or wrong lang attribute on an Arabic pageserious
ar-html-lang
How we measure
We fetch the page as ArablyzerBot, following its redirects, and read the HTML as the server sends it, before any JavaScript runs. We count the letters in the visible text; the tool applies when more than half of them are Arabic-script letters, which includes Persian, Urdu and other languages written in Arabic script. Then we apply two rules: the page's direction and its language. The same page gives the same result on every check.