Jump to content

SEO issue due to multi language in KB


Ebin V Thomas

Recommended Posts

Hello,

I was facing SEO "duplicate contents" issues in whmcs due to whmcs multi-language and cart pages indexed in google. So to prevent google indexing, I edited the modules/{template}/header.tpl. And add the below tag; I believe it will avoid google indexing of clientarea.php "pages", login and register and cart. Since we are using WHMCS KBs for writing FAQs and support articles, we must allow KB pages to be indexed in Search engines. But we need to avoid multiple language page indexing. Because it harms our website SEO, can anyone suggest something to fix this? 

 

{if $filename=='clientarea' or $filename=='login' or $filename=='register' or $filename=='cart'}
<meta name="robots" content="noindex,nofollow" />
{else}
<meta name="robots" content="index,follow" />
{/if}

 

We are using whmcs "lagom"  templates. How we can fix KB multi language page duplicate entries and avoid SEO issues. 

Link to comment
Share on other sites

I dont use the KBs but assume they use a template, so you may be able to use {if ($templatefile) eq 'xxx'}  in header.tpl for meta data

{if ($templatefile) eq 'kb'}
<meta name="description" content="{$KB.headline}">
<meta name="keywords" content="{$KB.headline}">
{/if}

and similarly use the header.tpl to define a canonical URL dynamically

ie <link rel="alternate" hreflang="bg-bg" href="https://www.yourdomainname.com/kb.php?kbid={$kbid}" />

I have no idea what the actual KB parameters are so you'll have to dig those out but this hopefully helps

These are all basic things that should have been part of WHMCS many moons ago

Link to comment
Share on other sites

Thank you for the replay .I am little bit confused , I am a adding my template header file code here , can you suggest the edit 

 

 

 

{if file_exists("templates/$template/overwrites/header.tpl")}
    {include file="{$template}/overwrites/header.tpl"}
{else}
    
    <!DOCTYPE html>
    <html lang="en" {if ($language == 'arabic' || $language == 'hebrew' || $language == 'farsi') && file_exists("templates/{$template}/assets/css/theme-rtl.css")}dir="rtl"{/if}>
    <head>
       
       {if $filename=='clientarea' or $filename=='login' or $filename=='register' or $filename=='cart'}
<meta name="robots" content="noindex,nofollow" />
{else}
<meta name="robots" content="index,follow" />
{/if}
       
        <meta charset="{$charset}" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
        {include file="$template/includes/common/seo.tpl"}
        {include file="$template/includes/head.tpl"}
        {$headoutput}
        
        

    </head>
    
    
    
    <body class="lagom{if $bodyClasses} {$bodyClasses}{if $bodyClasses|strstr:'page-login' && $RSThemes.pages[$templatefile].name != 'sidebar'} page-login-{$loginBgStyle}{/if}{/if}{if !$loggedin} lagom-not-portal{/if}{if $RSThemes.layouts.vars.bodyClass} {$RSThemes.layouts.vars.bodyClass}{/if}{if $RSThemes.styles.vars.bodyClass} {$RSThemes.styles.vars.bodyClass}{/if}{if !$templatefile|strstr:"/"} page-{$templatefile}{/if}{if $pageModuleName} page-{$pageModuleName}{/if}{if $module} page-{$module|lower|replace:" ":""}{/if}{if $mgCaResult['vars']['mainName']} page-{$mgCaResult['vars']['mainName']|lower|replace:" ":""}{/if}{if $loggedin} page-user-logged{/if}{if $RSThemes['pages'][$templatefile]['config']['isFullPage'] == "1" || $RSThemes['pages'][$templatefile]['optionvars']['isFullPage'] == "true" || $templatefile=="oauth/layout"} page-type-full{/if}" data-phone-cc-input="{$phoneNumberInputStyle}">
    {if $lagomClientAlerts->header} 
        {$lagomClientAlerts->header}
    {/if}
    {$headeroutput}

    {if isset($RSThemes.layouts)}
        {include file=$RSThemes['layouts']['mediumPath']}
    {else}
        {include file="templates/{$template}/core/layouts/main-menu/default/default.tpl"}
    {/if}
{/if}

 

Link to comment
Share on other sites

file :  /templates/templatename/includes/common/seo.tpl

please suggest , how we can implement 

 

{if file_exists("templates/$template/includes/common/overwrites/seo.tpl")}
     {include file="{$template}/includes/common/overwrites/seo.tpl"}  
{else}
    <title>
        {if isset($pageSeo['title'][$language]) && $pageSeo['enabled']}
            {$pageSeo['title'][$language]}
        {elseif $kbarticle.title}
            {$kbarticle.title}    
        {elseif $templatefile == "viewinvoice" || $templatefile == "viewquote" || $templatefile == "clientareahome"}
            {$pagetitle}
        {else}
            {$displayTitle}
        {/if} - {$companyname}
    </title>
    
    
    {if $pageSeo['enabled']}
        {if isset($pageSeo['description'][$language])}<meta name="description" content="{$pageSeo['description'][$language]}">{/if}
        {if isset($activeDisplay) && $activeDisplay == 'CMS'}
            <meta name="robots" content="{if $pageSeo['robots'] == 0}noindex nofollow{else}index follow{/if}">
        {/if}
        <meta name="og:type" content="{if $templatefile == 'homepage'}website{else}article{/if}">
        <meta name="og:title" content="{if isset($pageSeo['title'][$language])}{$pageSeo['title'][$language]}{else}{$displayTitle}{/if}">
        {if isset($pageSeo['description'][$language])}<meta name="og:description" content="{$pageSeo['description'][$language]}">{/if}
        {if isset($pageSeo['image'])}<meta property="og:image" content="{$systemurl}templates/{$template}/assets/img/page-manager/{$pageSeo['image']}">{/if}
        <meta name="og:url" content="{$systemurl}{$smarty.server.REQUEST_URI|ltrim:'/'}">
        <meta name="twitter:title" content="{if isset($pageSeo['title'][$language])}{$pageSeo['title'][$language]}{else}{$displayTitle}{/if}">
        {if isset($pageSeo['description'][$language])}<meta name="twitter:description" content="{$pageSeo['description'][$language]}">{/if}
        {if isset($pageSeo['image'])}<meta property="twitter:image" content="{$systemurl}templates/{$template}/assets/img/page-manager/{$pageSeo['image']}">{/if}
    {/if}
{/if}    

 

Link to comment
Share on other sites

9 hours ago, bear said:

Helpful if you don't keep the fix to yourself?

Sure. Here is the code.

 

 

    {if $templatefile == "knowledgebasearticle" || $templatefile == "viewannouncement"}
        <meta name="description" content="{if $templatefile == "viewannouncement"}{$summary|truncate:155:"..."}{elseif $templatefile == "knowledgebasearticle"}{$kbarticle.text|strip_tags|truncate:155:"..."}{/if}">
    {/if}

 

 

 

Link to comment
Share on other sites

  • 7 months later...
On 7/10/2022 at 10:33 AM, Ebin V Thomas said:
{if $templatefile == "knowledgebasearticle" || $templatefile == "viewannouncement"}
        <meta name="description" content="{if $templatefile == "viewannouncement"}{$summary|truncate:155:"..."}{elseif $templatefile == "knowledgebasearticle"}{$kbarticle.text|strip_tags|truncate:155:"..."}{/if}">
    {/if}

Where to put this code?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated