Pages Have No Hreflang And Lang Attributes
Fix Missing hreflang and lang Attributes
If your Semrush site audit reports that your pages are missing hreflang or lang attributes, it means search engines don’t know which language (and sometimes region) your content is written for. This can cause indexing issues, confusion for international visitors, or SEO inefficiencies.
Let’s break down what these attributes do — and how to fix them quickly in WordPress.
What Are lang and hreflang Attributes?
lang attribute:
This tells browsers and crawlers which language your page is written in. For most English-language sites, you’ll want to use lang="en".
Example:
<htmllang="en">hreflang attribute:
This one’s a bit different — it’s used when you have multiple language or regional versions of your site. For example:
- en-us for U.S. English
- en-gb for U.K. English
- fr-fr for French (France)
If you run sites that target visitors in different countries, hreflang helps Google serve the correct version to users in each region.
Why It Matters for SEO
Google and other search engines rely on these attributes to:
- Identify the primary language of your content.
- Serve the right version of a page to international visitors.
- Make your site more accessible for assistive technologies like screen readers.
Without these tags, your pages may be harder to index correctly — or even appear in the wrong country’s search results.
How to Add a lang Attribute in WordPress
- Log in to your WordPress dashboard.
- From the left-hand sidebar, go to Appearance → Theme File Editor.
- Locate the file named header.php (sometimes called Theme Header).
- Find the
<!DOCTYPE html>declaration near the top of the file. - Just below that line, add the HTML language attribute like this:
html
<htmllang="en"> - Click Update File to save your changes.
That’s it — your pages now tell search engines the language of your content.
When to Use hreflang
If you operate multiple language or region-specific versions of your site — say, one for the U.S. and another for the U.K. — you’ll need to implement hreflang tags. These tags are more complex and are usually managed through your SEO plugin or with XML sitemaps.
If that’s your situation, check out Semrush’s tutorial on fixing hreflang issues — it goes deeper into best practices for multilingual and multi-regional SEO.
