Question

I am using Liferay 6.1 and have developed theme in the same. My problem is when i load the theme the head section contains huge links as shown below:

<link rel="alternate" hreflang="ar-SA" href="http://localhost/ar">
<link rel="alternate" hreflang="eu-ES" href="http://localhost/eu">
<link rel="alternate" hreflang="bg-BG" href="http://localhost/bg">
<link rel="alternate" hreflang="ca-AD" href="http://localhost/ca">
<link rel="alternate" hreflang="ca-ES" href="http://localhost/ca_ES">
<link rel="alternate" hreflang="zh-CN" href="http://localhost/zh">
<link rel="alternate" hreflang="zh-TW" href="http://localhost/zh_TW">
<link rel="alternate" hreflang="hr-HR" href="http://localhost/hr">
<link rel="alternate" hreflang="cs-CZ" href="http://localhost/cs">
<link rel="alternate" hreflang="da-DK" href="http://localhost/da">
<link rel="alternate" hreflang="nl-NL" href="http://localhost/nl">
<link rel="alternate" hreflang="nl-BE" href="http://localhost/nl_BE">
<link rel="alternate" hreflang="en-GB" href="http://localhost/en_GB">
<link rel="alternate" hreflang="et-EE" href="http://localhost/et">
<link rel="alternate" hreflang="fi-FI" href="http://localhost/fi">
<link rel="alternate" hreflang="fr-FR" href="http://localhost/fr">
<link rel="alternate" hreflang="gl-ES" href="http://localhost/gl">
<link rel="alternate" hreflang="de-DE" href="http://localhost/de">
<link rel="alternate" hreflang="el-GR" href="http://localhost/el">
<link rel="alternate" hreflang="iw-IL" href="http://localhost/iw">
<link rel="alternate" hreflang="hi-IN" href="http://localhost/hi">
<link rel="alternate" hreflang="hu-HU" href="http://localhost/hu">
<link rel="alternate" hreflang="in-ID" href="http://localhost/in">
<link rel="alternate" hreflang="it-IT" href="http://localhost/it">
<link rel="alternate" hreflang="ja-JP" href="http://localhost/ja">
<link rel="alternate" hreflang="ko-KR" href="http://localhost/ko">
<link rel="alternate" hreflang="lo-LA" href="http://localhost/lo">
<link rel="alternate" hreflang="nb-NO" href="http://localhost/nb">
<link rel="alternate" hreflang="fa-IR" href="http://localhost/fa">
<link rel="alternate" hreflang="pl-PL" href="http://localhost/pl">
<link rel="alternate" hreflang="pt-BR" href="http://localhost/pt">
<link rel="alternate" hreflang="pt-PT" href="http://localhost/pt_PT">
<link rel="alternate" hreflang="ro-RO" href="http://localhost/ro">
<link rel="alternate" hreflang="ru-RU" href="http://localhost/ru">
<link rel="alternate" hreflang="sr-RS" href="http://localhost/sr">
<link rel="alternate" hreflang="sr-RS-latin" href="http://localhost/sr_RS_latin">
<link rel="alternate" hreflang="sl-SI" href="http://localhost/sl">
<link rel="alternate" hreflang="sk-SK" href="http://localhost/sk">
<link rel="alternate" hreflang="es-ES" href="http://localhost/es">
<link rel="alternate" hreflang="sv-SE" href="http://localhost/sv">
<link rel="alternate" hreflang="tr-TR" href="http://localhost/tr">
<link rel="alternate" hreflang="uk-UA" href="http://localhost/uk">
<link rel="alternate" hreflang="vi-VN" href="http://localhost/vi">

I want remove languages that are not needed. I want these links to be removed as this is not the good practice for SEO. I want a default language for a theme. I tried adding translations.disabled=true in the portal-ext file but this didnt worked.

Your any suggestions are appreciated.

Was it helpful?

Solution

You have to restricted to the locales you want to use, adding the "locales" property to portal-ext.porperties. To restrict it to englisch and german for example, you can do this

locales=en_US,de_DE

OTHER TIPS

See also the official wiki documentation

I quote it here:

Removing unwanted language

By default, Liferay supports all the follow languages (excerpt from portal.properties of Liferay 4.3.3):

locales=ar_SA,ca_AD,ca_ES,zh_CN,zh_TW,cs_CZ,nl_NL,en_US,fi_FI,fr_FR,de_DE,el_GR,hu_HU,it_IT,ja_JP,ko_KR,fa_IR,pt_BR,ru_RU,es_ES,sv_SE,tr_TR,vi_VN

If we only want to support English, German and Spanish, we simply remove the unwanted locales so that our locales value looks like this:

locales=en_US,de_DE,es_ES

The portal-ext.properties settings can be overridden my Portal settings at Control Panel > Settings > Display Settings > Available Languages. I'd say it's safe to set them there.

Also, there is a per-page option in the SEO section to disable the canonical links there.

go to web.xml and delete language mapping url after that start the server.

url--tomcat-7.0.42\webapps\ROOT\WEB-INF

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top