2

I have Sitecore JSS site where I have a problem that the links are having rel=”norefferrer” which is stopping Google analytics of operators see traffic from sitecore JSS website. I need to remove the noreferrer value on the links. Below is sample how its being implemented

<Link
     field={{
        value: {
        href: 'https://xyz.abc',
        text: 'xyz',
        target: '_blank',
        url: 'https://xyz.abc',
        linktype: 'internal',
       },
     }}
></Link>

It looks like using target: '_blank' is adding this, where linktype: 'internal' has no effect in rel(tried to remove linktype: 'internal' but on removal rel had value as rel=”norefferrer”). Here it looks like it is added from Sitecore 8.2, Any idea or suggestion to achieve this?

Thanks

1

3 Answers 3

1

https://doc.sitecore.com/xp/en/developers/hd/latest/sitecore-headless-development/jss-components-for-rendering-sitecore-fields-in-next-js-applications.html#usage-3

Looks that below usage will solve this issue which will over ride rel

<Link
  field={props.fields.externalLink}
  showLinkTextWithChildrenPresent={true}
  className="font-weight-bold"
  rel= "noopner"

/>
1

In sitecore JSS, the "rel=noreferrer" mainly used for security reason and it is automatically added to links that open in a new tab. "target=_blank" case.

It is mainly use to prevent the passing of referrer information to the target website.

to remove that simply need to add rel="noreferrer" attribute, you can manually control the rel attribute in sitecore link component

<Link
      aria-label={field?.value?.text ?? field?.value?.href}
      field={field}
      className={className}
      rel={null}
    />

for "rel" attributes there are other values as well you can pass based on your scenario like, Mostly used:

rel={null}
rel="noreferrer"
rel="noopener"

Reference link: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel

0

It looks a known issue and found in all Sitecore versions. Which Sitecore version you are using?

Seems like you need to raise a Sitecore Support ticket and ask for a patch for the version you are working on.

Patch for below are available per the article here: https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0339618

To resolve this issue, consider one of the following options:

For Sitecore XP 8.2 Update-4 - 9.0 Update-2, download and install the appropriate patch available on this page: https://github.com/SitecoreSupport/Sitecore.Support.223855/releases.

For Sitecore XP 9.1 Initial Release - 9.2 Initial Release, upgrade the Sitecore instance to XP 9.3 Initial Release (recommended).

2
  • This is not the same thing, the bug you are linking do duplicates the norefferrer and only for links in the RTE.
    – Richard Seal
    Commented Aug 1 at 14:38
  • Its Sitecore 10.2 headless jss, as mentioned this is stopping Google analytics of operators see traffic from Sitecore JSS website. Commented Aug 1 at 23:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.