Expand my Community achievements bar.

SOLVED

Canonical Tags

Avatar

Level 2

May I know if there's a way to remove canonical tag on a specific page in AEM?

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi @hello299  you can alway use : Page Properties Dialog and if you want to remove programmatically you can use
JCR API: you can programmatically remove the cq:canonical property from the page node.
or Sling API: you can programmatically remove the cq:canonical property from the page node.

View solution in original post

7 Replies

Avatar

Community Advisor

Hi @hello299 

 

Go to the page properties and navigate to Advanced section and there you will find option to remove canonical URL

 

AvinashGupta01_0-1670426617587.png

 

Hope this helps.

Avatar

Level 2

How did you add this in your page properties. Cannot find at my end

Sejal29_0-1670429818060.png

 

Avatar

Community Advisor

These properties are available OOB with AEM 6.5 instance. May I know what's the AEM instance version are you using?

Avatar

Community Advisor

Hi @hello299 

 

First thing is to identify how they are being added to the page. If it is at the head, you need to write some js code to identify the pages that you need and remove the tags in dom.

 

Hope this helps!

 

Thanks,

Kiran Vedantam.

Avatar

Community Advisor

Hi @hello299 

Why do you want to remove canonical tag from just few pages? can you explain the use case here?



Arun Patidar

Avatar

Correct answer by
Level 7

Hi @hello299  you can alway use : Page Properties Dialog and if you want to remove programmatically you can use
JCR API: you can programmatically remove the cq:canonical property from the page node.
or Sling API: you can programmatically remove the cq:canonical property from the page node.