How to deactivate/modify automatic canonical url generator in liferay 7.3?

Jamie Sammons, geändert vor 1 Jahr. New Member Beiträge: 2 Beitrittsdatum: 31.12.24 Neueste Beiträge

Hi,

i am using Liferay DXP 7.3 and i have automatically generated canonical urls for my site..

I have 4 locales selected for my site and i want to generate canonical urls for only 2 of them..But liferay automatically generates canonicals for all the 4 locales selected. Also liferay is not appending the language code for the alternate url generated for the default language. i have to override this behaviour also..

How can i achieve this?

i have tried using a dynamicInclude and generated custom urls programatically to top_head.jsp..

But i have to disable the automatic url generation so that only the urls from dynamicinclude appears on the html..How can i deactivate automatic canonical url generetaion in liferay?

Jamie Sammons, geändert vor 1 Jahr. New Member Beitrag: 1 Beitrittsdatum: 08.04.25 Neueste Beiträge

@Akhil Raj, please to share the solution if it is founded  

Jamie Sammons, geändert vor 12 Monaten. New Member Beiträge: 2 Beitrittsdatum: 31.12.24 Neueste Beiträge

I found the solution by adding a hook.

The auto Url generation cannot be deactivated. instead i have used a hook to override the service that is building this url patterns in page source.

We have to override the service

LayoutSEOLinkManagerImpl

using a hook.

deploy the hook and then we have to blacklist the original component from System settings -> Module container -> Component blacklist