Ebin V Thomas Posted September 28, 2022 Share Posted September 28, 2022 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. 0 Quote Link to comment Share on other sites More sharing options...
Ebin V Thomas Posted October 4, 2022 Author Share Posted October 4, 2022 Also "Meta Description tag missing" in KB article pages. Is there any way we can fix that in bulk ? 0 Quote Link to comment Share on other sites More sharing options...
MrGettingRatherFrustrated Posted October 4, 2022 Share Posted October 4, 2022 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 0 Quote Link to comment Share on other sites More sharing options...
Ebin V Thomas Posted October 4, 2022 Author Share Posted October 4, 2022 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} 0 Quote Link to comment Share on other sites More sharing options...
Ebin V Thomas Posted October 4, 2022 Author Share Posted October 4, 2022 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} 0 Quote Link to comment Share on other sites More sharing options...
Ebin V Thomas Posted October 6, 2022 Author Share Posted October 6, 2022 I am able to fix this issue with he help of our template developers. Thank you 0 Quote Link to comment Share on other sites More sharing options...
bear Posted October 6, 2022 Share Posted October 6, 2022 2 hours ago, Ebin V Thomas said: I am able to fix this issue with he help of our template developers. Helpful if you don't keep the fix to yourself? 0 Quote Link to comment Share on other sites More sharing options...
Ebin V Thomas Posted October 7, 2022 Author Share Posted October 7, 2022 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} 0 Quote Link to comment Share on other sites More sharing options...
Ebin V Thomas Posted October 7, 2022 Author Share Posted October 7, 2022 Now I am able to fix the meta tag description issue on KB articles. But issues is still there for KB tag , announcement and store pages ! 0 Quote Link to comment Share on other sites More sharing options...
vinod makwana Posted May 31, 2023 Share Posted May 31, 2023 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? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.