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

Jamie Sammons, modificado 1 Ano atrás. New Member Postagens: 2 Data de Entrada: 31/12/24 Postagens Recentes

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, modificado 1 Ano atrás. New Member Mensagem: 1 Data de Entrada: 08/04/25 Postagens Recentes

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

Jamie Sammons, modificado 12 Meses atrás. New Member Postagens: 2 Data de Entrada: 31/12/24 Postagens Recentes

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