Today you're going to learn how to add Hreflang tag in WordPress without a plugin. We will not use Like Polylang tag, HREFLANG Tags Lite WordPress Plugin.
Is your blog consisting of a particular region? The hreflang tag will then help your website to improve SEO for those areas that are spoken mainly in those languages.
If you still do not know the exact idea of why the Hreflang tag is necessary,
Then let me give an example,
In India, Hindi is a national language, a large number of people speak Hindi. Many other languages are spoken in India, such as Bengali, Gujarati, Tamil, Telugu.
so you have to be clear about what your blog's target audition is and understand which language they speak.
It is important for search engines to show that your site's language content is not reused and to provide guidelines on the pages that you want to list for alternate languages in different countries.
If you want to show the page is for users in more than one country or region, you can use multiple hreflangs tag on one page also.
So Now you understand that you have to write in which language and which target audience is your right?
Now it comes to know that How are we going to tell Google Search Engine that our blog is in which language and our targeted audience is?
The answer is simple we use the hreflang tag. So here again the question is what does Hreflang mean? Don't worry that I'll explain, let's see ...
Before we going further. must Watch Video for Getting Depth of hreflang tag.
What is hreflang tag?
According to wikipedia, the hreflang tag is the HTML meta element. Hreflang defines the language and possible regional requirements of the text.
WordPress is available in over 60 languages. So you've got to add the Hreflang tag. It tells Google in which language your blog is posted.
I.g. If one page of your blog post is in A language and the other page is in B language, Google will get that information from your blog. When the hreflang tag has been added.
Below is a sample code,
<link” rel=”alternate” hreflang=”en-us” href=”https://example.com/” />
What is ISO Language and Region Codes
The hreflang tag is a mixture of the code of the language and the code of the country. for example, En-us for English and the United States.
Examples of the Hreflang tag on popular site
Here I give an example of a Very popular website that uses the hreflang tag on their pages.
<link” rel=”alternate”hreflang=”en” href=”https://www.facebook.com” />
<link” rel=”alternate”hreflang=”hi” href=”https://hi-in.facebook.com” />
<link” rel=”alternate”hreflang=”pt” href=”https://pt-br.facebook.com” />
<link” rel=”alternate”hreflang=”es” href=”https://es-la.facebook.com” />
How to Generate a hreflang tag for your blog/Website.
Generate hreflang tag for your blog here.
- 1Enter your Blog Address.
- 2Select Language of your blog
- 3Select Your Targeted Country
- 4If you want to Generate HTML code then Tik only it
- 5If you want to Generate XML Sitemap then Tik only it
- 6Finally, Press the Button for getting your code and Copy these code or Save
Where to put the code for hreflang tag
It is easiest to put the hreflang attribute in the HTTP header, or the sitemap.
How to Add Hreflang Tags in WordPress Without WordPress Plugin
I'm going to tell you two methods here that you can use any of them.
They're both fully working. You can test it in the hreflang testing tool after adding it.
Method 1: Add hreflang Tag in WordPress Using Header.php
in this method, We need to edit the WordPress header.php file.
Log into your WordPress dashboard and select Appearance -> Theme Editor From this view, you can access your Theme Files.
On the right hand side you will see all the files in your template. Find the file titled, Theme Header or header.php. This is the only file you will need to edit.
In the image below, you will see that I put my generated hreflang Tag under the <Head>.
So the 1st method is complete. Your hreflang Tag has been inserted into your blog in a perfect way. kudos!!
Note : If you Don't Find header.php file or any Doubt or confusion about it. If you think the header.php file update will impact my site so that you can skip this process and use Directly the 2nd method.
in this method, We're going to use the Insert Headers and Footers Plugin. Typically we use this plugin to add a script to our header or body field.
If this plugin is working in your WordPress, it's cool, if not, to download it from here.
It's safe and doesn't influence the speed of your blog. Its plugin is also going to be helpful in the future.
SPEED OPTIMIZED WORDPRESS, 20X FASTER WEB HOSTING
Now, Go to the your WordPress dashboard and select Settings -> Insert Headers and Footers
You will find like below image. past your hreflang Tag into Scripts in Header Box.
Boom!! You're Done.
I hope this post will help you find out How to Add Hreflang Tags in WordPress without Install WordPress plugin.
Both methods will work for you, but remember to use any one of them.
If you liked this post, Please share it because I wrote this post to help you after doing a lot of research and experimenting with myself.
to download free eBook for
"The Complete SEO Checklist For 2020"
WHAT OTHERS ARE READING :