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
0
votes
0answers
37 views

Magento2 wrong category url with $category->getUrlPath()

I want to set hreflang-tag and try to get category-urls from different store-views: $category = $this->categoryRepository->get($this->registry->registry('current_category')->getId(), $...
3
votes
2answers
261 views

How to get category URL in multiple stores

I'm trying to generate the hreflang 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 come up with this: $...
0
votes
0answers
25 views

Create a variable href link using URL Key

I'd like to create an a href link using URL key. For instance, the url key is swim-bottoms. The page is www.example/swimwear/swim-bottoms.html. There is also a website version that's www....
0
votes
1answer
370 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?
1
vote
2answers
412 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 ...
6
votes
2answers
2k 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 ...
1
vote
1answer
47 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/...
0
votes
1answer
370 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. <?...
0
votes
1answer
587 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')->...
0
votes
1answer
150 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 ...
1
vote
2answers
554 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 / ...
2
votes
3answers
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) { ...
1
vote
1answer
54 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()-&...
2
votes
1answer
616 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()-&...
3
votes
5answers
4k 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 ...
2
votes
1answer
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 ...
2
votes
1answer
769 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....
5
votes
8answers
12k 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 (...
1
vote
2answers
2k 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="...