If you have those questions, I’m here to help you.
In this article, I’m going to show you the following topic;
- What is Hreflang?
- What if you don’t set it up?
- How to set up Hreflang on WordPress
- How to set it up on WordPress
- The result after implementing
This is a niche topic that is useful for SEO experts managing multilingual websites or working in an international company.
Let’s dive in.
- What is hreflang？
- What if you don’t set up hreflang?
- How to set up hreflang
- How to set up hreflang in WordPress： Use plugin “hreflang tags lite”
- Result after adding Hreflang tags
What is hreflang？
Hreflang specifies the language and optional geographic restrictions for a document. Hreflang is interpreted by search engines and can be used by webmasters to clarify the lingual and geographical targeting of a website.
Ref: hreflang | Wikipedia
Hreflang tag is to tell Google that which language the page is using.
What if you don’t set up hreflang?
Let’s see it on my Japanese and English blogs.
My blog’s title is “Heysho” so I want to show my blog on the top position on Google search result when users type “Heysho”.
I typed “Heysho” on google.com from USA, and the result was not good.
The search result from USA
I see my Japanese blog on the 7th and English blog on 8th.
This is because my blog does not have hreflang tag and Google does not know if I want to show my English blog for English speakers.
Now I’m going to implement “hreflang tag” to rank up the English blog.
How to set up hreflang
I am going to implement hreflang on the 2 pages below;
- Japanese Page：4か月で月間10万PVのブログを作った経験談【短期間でアクセスを伸ばす方法】| https://heysho.com/how-to-grow-blog-quick/
- English Page： How I made a blog with 100,000 monthly pageviews in 4 months | https://heysho.com/en/how-to-grow-blog-quick/
The process is to include the code below into <head>.
<link rel="alternate" href="https://heysho.com/en/how-to-grow-blog-quick/" hreflang="en" />
<link rel="alternate" href="https://heysho.com/how-to-grow-blog-quick/" hreflang="ja" />
If you run a WordPress Blog, there is a good plugin called “hreflang tags lite” which can help you set up hreflang tags on each page quick.
Fyi, I looked for many similar plugins and this one was the best in my opinion.
Here is how to set it up;
Step1: Check “Post” and “Pages” from HREFLANG setting page after installing the plugin
Step2: Add URL and language from the other language article on each post
This is for article pages.
I was looking for the way to set up for homepage, but seems like I can’t make it with this plugin.
So I just added the Hreflang tags on child theme manually.
Move your header.php to your child-theme, and go to header.php to add this code;
<?php if(is_home() && !is_paged()): ?> <link rel="alternate" href="The home page URL from other language" hreflang="The language code" /> <?php endif; ?>
Here is what I added on my English blog’s homepage.
<?php if(is_home() && !is_paged()): ?> <link rel="alternate" href="https://heysho.com/" hreflang="ja" /> <?php endif; ?>
After a few days, I saw my English blog came on 5th and Japanese blog on 6th.
Looks like it’s successful.
Thanks for reading my article.
If you like the article, please share, leave your comment or subscribe.
I’d be happy to connect with you.