question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatically add hreflang-links

See original GitHub issue

What version of this package are you using? 1.5.0

What problem do you want to solve? When a site is translated in different languages, it should inform search engine crawlers about the other languages. Since next-translate is already altering the pages, it should be possible to insert the <link rel="alternate" hreflang="lang_code" href="url_of_page" /> for every locale automatically.

What do you think is the correct solution to this problem? Out of my head, I would say add a component which does exactly that, using Next/Head, the current route and the locales

Are you willing to submit a pull request to implement this change? Maybe, i’m not sure when I will find the time for this

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Ainiascommented, Aug 19, 2022

That makes sense, thanks for explaining it 😃

0reactions
aralrocacommented, Aug 19, 2022

However @Ainias, even if it is not the goal of this library, feel free to create a library that does it. In fact it is not so much related to next-translate, so other people who use other libraries to translate pages (like reacti18next) can use it too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Add Hreflang Tags Automatically (and Enhance Your ...
Watch this video and learn how to add hreflang tags using WebSite Auditor. Download WebSite Auditor for free: ...
Read more >
How To Add hreflang tags In Wordpress
The easiest method of hreflang implementation is to use a WordPress plugin. Plugins like MultilingualPress add hreflang tags for you ...
Read more >
How to Add Hreflang in WordPress
Adding hreflang WordPress tags is vital to ensuring search engines properly index your content. In this post, we explain how to do it!...
Read more >
How to Add Hreflang Tags (Without Breaking Your SEO)
Many people use hreflang tags wrong, and that's bad news for your SEO. Our clear guide shows you how to add them correctly....
Read more >
How to add hreflang tags to your WordPress website
Adding hreflang tags to your XML sitemap simplifies the manual hreflang implementation process. This is because you'll essentially place all ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found