Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [hreflang]

The hreflang tag is used to signal alternate language versions of the specified URL. This helps search engines like Google to better understand multilingual websites.

Filter by
Sorted by
Tagged with
8 votes
2 answers
3k views

Get page URL from current page, different store-view

I'm using different store-views to create different language versions of a shop. Now I'm trying to add links to the other pages. However, I can not find a way to get the actual URL from the other ...
Sander Koedood's user avatar
5 votes
8 answers
15k views

How to add hreflang tags (or other meta tags) to pages in magento?

Hi using info from this site and around the web I have started to add hreflang tags to my magento store. They work and display as they should on the default (American)site, however on the alternate (...
user4517's user avatar
  • 353
4 votes
3 answers
3k views

How to get category URL in multiple stores

I'm trying to generate the href links for our multilingual Magento 2 site, and as the category slug changes, I cannot simply replace the store code in the URL. I've code is given below : $...
werfu's user avatar
  • 200
3 votes
5 answers
5k views

Magento hreflang tags: How to get URL Key per Store View?

I have been trying to add hreflang tags to a multi-language project following the answers to this question. In my setup there is one website, one store and there are three store views (English, German ...
MatthijsIJ's user avatar
  • 3,622
2 votes
1 answer
839 views

hreflang tags for multiple websites?

I have three websites under single magento installation and would like to generate hreflang tags for each websites manually. I used the code mentioned in this question <?php foreach (Mage::app()-&...
user avatar
2 votes
1 answer
825 views

Add the hreflang in link for each category

i have using the same url for different languages. <reference name="head"> <action method="addLinkRel"> <rel>alternatve</rel> <href>https://www.example....
Manikandan's user avatar
2 votes
1 answer
1k views

Different domain for different store view (language)

Is it possible to have different views of my site (for languages / currencies) hosted off different domains for example: www.myshop.co.uk - English (GBP) version of the site www.myshop.ie - English ...
alexjamesbrown's user avatar
2 votes
3 answers
2k views

How to remove ?___store= from hreflang url?

<?php foreach (Mage::app()->getWebsites() as $website) { foreach ($website->getGroups() as $group) { $stores = $group->getStores(); foreach ($stores as $store) { ...
user avatar
1 vote
2 answers
754 views

Magento2: Need current URL in HTML-head: Scripts and Style Sheets for hreflang

My question is about using Magento2 HTML-head to generate hreflang links. In Admin Content Configuration Store View HTML-Head Scripts & Styles I need the current URL for hreflang. I have tried ...
rico's user avatar
  • 11
1 vote
2 answers
836 views

How to add correct hreflang for google like "en-gb" instead of "en_GB"

I have multiple store site in magento. i wanted to add hreflang for my stores and thanks to one of the post here i have managed to do so. the code i wrote in my app / design / frontend / mytheme / ...
shafiq's user avatar
  • 295
1 vote
1 answer
54 views

Exclude storeview in hreflang generation

I use this code for the href language in my head.phtml <?php $website = Mage::app()->getWebsite()->getStores(); foreach ( $website as $store) { $lang = $store->getConfig('general/...
Ronny's user avatar
  • 433
1 vote
0 answers
78 views

Product names are randomly translated in Magento widget

I've implemented a custom product slider in my Magento store. Sometimes the product titles in the slider are in English instead of Dutch on the Dutch storeview. When I empty the cache everything ...
IvoJongmans's user avatar
1 vote
1 answer
690 views

No x-default hreflang implemented (Magento 2.2.4)

This is a mention from a SEO scan. Is there an easy way to implement this?
Julian Murillo's user avatar
1 vote
1 answer
71 views

Hreflang php code for getstore instead of getwebsite

I am using the following code to generate the hreflang on my website: <?php $groupId = Mage::app()->getStore()->getGroupId(); $collection = Mage::getModel('core/store')->getCollection()-&...
Ameeds's user avatar
  • 21
1 vote
3 answers
3k views

Magento multi store views with rel="alternate"

I'm running single Magento 1.7 installation with 2 store views. I have two domains which are search engine optimized for Ireland and UK. Since content is very similar I would like to use rel="...
arekstasiewicz's user avatar
0 votes
1 answer
483 views

Creating a register link inside of ko text

Fairly easy question for most but it's somewhat tricky and I'm having issues. <span class="note" data-bind="fadeVisible: isPasswordVisible() == false"><!-- ko ...
Singleton's user avatar
0 votes
0 answers
19 views

Multiple hreflang on one page - duplicate content store views

We have a Magento 2 shop in 3 languages German, English and Spanish. Does it make sense to include all hreflangs for Spanish and English speaking countries in the sitemap? Or would this lead to ...
Ben's user avatar
  • 141
0 votes
1 answer
116 views

Magento 2 : How to get hreflang from address url?

When i have the address: <link rel = "alternate" hreflang = "de" href = "..." />. I would like to take the hreflang value from this address, meaning "de"....
bambo's user avatar
  • 3
0 votes
1 answer
402 views

hreflang multi language with backend URL?

I am adding hreflang-tags to a multi-language Magento store. I found the code below on here and used it in the page header. It does what it's supposed to, but I'm looking for another solution. <?...
EasyBizz's user avatar
0 votes
1 answer
1k views

hreflang for 2 storeview with different URL [duplicate]

We have insert this code in the header.phtml to have on all web page: <?php $groupId = Mage::app()->getStore()->getGroupId(); $collection = Mage::getModel('core/store')->...
westh's user avatar
  • 53
0 votes
1 answer
174 views

Multilingual site. Separate domains. hreflang issues

I'm trying to set up a multi-lingual site for a client but having some issues with conflicting ideas. It's a UK based client selling to the UK and Europe. They'd like to serve different prices for UK ...
user2565123's user avatar