Jump to content

doubt on WHMCS SEO


Recommended Posts

Hello,

 

We enabled WHMCS with fully SEO friendly URL.  So when we open a KB , the URL's will be open like https://website.com/knowledgebase/254/testarticle.html

We created new sitemap with all these URLs and submitted on search engine . But we can see "canonical URL" need to mention in each page code. so when we inquire, we able to understand ,
if we add  below mentioned code  in "header.tpl"  , it will fix the error . but I am worried if the  "canonical URL"   set  is completely different  with the  url mentioned in sitemap , it affect our SEO.

Can anyone suggest something to fix this issue. 

 

 

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

 

 

 

 

Link to comment
Share on other sites

  • 6 months later...

No one replied yet. !

 

as per the support response,i created a hook and added below code. But still its not working 

<?php

add_hook('ClientAreaHeadOutput', 1, function($vars) {
       $template = $vars['$template'];
    $SystemURL = 'https://www.domain.com';
    $url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    $url = strtok($url, '?');
    return <<<HTML
    <link rel="canonical" href="{$url}"/>
HTML;
});

 

also tried the below code, still not working. can anyone help ?

<?php

add_hook('ClientAreaHeadOutput', 1, function($vars) {
       $template = $vars['$lagom2'];
    $SystemURL = 'https://www.domain.com';
    $url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    $url = strtok($url, '?');
    return <<<HTML
    <link rel="canonical" href="{$url}"/>
HTML;
});

 

can anyone help 

 

 

Link to comment
Share on other sites

Hello,

For me, this works:

<?php

add_hook('ClientAreaHeadOutput', 1, function($vars) {
    $url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    $url = strtok($url, '?');
    
    return <<<HTML
    <link rel="canonical" href="{$url}"/>
HTML;
});

Is there any way that I could check it personally?

Link to comment
Share on other sites

There is a problem with that. if google crawled somehow the old non-SEO-friendly URL, it gives the wrong canonical URL.


for example with knwoldeg base article: if a URL is like domain.com/clients/index.php?rp=/knowledgebase/920/test.html , then the canonical URL will be like below

  <link rel="canonical" href="https://www.domain.com/clients/index.php"/>

. It's the wrong URL.  so we need to add separate lines for KB, announcement and other system URLs in code .

like below for kb  :  

href="https://www.website.com/whmcs/knowledgebase/{$kbarticle.id}/{$kbarticle.urlfriendlytitle}.html

 

Edited by Ebin V Thomas
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