6

I have a custom page and I'm trying to add a canonical link to it. I see that in the layout file I can specify meta data in the head node. Is it possible to add the canonical link in the layout as well? Or what is the "right" way to add it to a custom page? Thanks

9

Hope you are looking for this one

<head>
      <link rel="canonical" src="pageurl" src_type="url"/>
</head>

Please change the 'pageurl' as per your requirements. And place it in custom layout section in admin , if you want the functionality using admin custom layout section.

I have used this with one of my category.

2

Adding to Dinesh's answer, you can also use the {{baseUrl}} variable if you want to make the URL dynamic.

<head>
    <link rel="canonical" src="{{baseUrl}}mypath" src_type="url"/>
</head>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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