Update Meta in WHMCS, OG Tags & Canonical Tags in WHMCS?

What Are Meta Tags?

The meta tags basically the codes written in HTML language for different search engines to know what a specific web page is about. The main motive of meta tags is to make Google understand the content and reference of a specific web page.

If you want to see meta tags then, you have to do the follows:

  • Open any web page, hit a right-click on it, and click on “see page source code”. You can also use the CTRL + U commands.

So, it is a quite critical element that makes your web page familiar with the search engines and the positioning of your website depends on it. Therefore, it is recommended to follow all the best practices to make your meta tags highly functional, website crawlable and everything smooth within. This will help search engines to capture your webpage better and efficiently.


Custom WHMCS Solutions


As you very well know that WHMCS does not have the option to add or update meta in WHMCS and titles for a specific product group, knowledgebase, and announcements.

Moreover, do not forget to use the best WHMCS Theme on your hosting website to manage, alter, and update all the crucial SEO website elements.

So here we are sharing the procedure by which you can update meta in WHMCS along with titles, descriptions, keywords, and canonical tags easily:

  • Step 1: Go to whmcsdir/templates/yourtemplate/header.tpl
  • Step 2: Download the header.tpl file
  • Step 3: Take a backup of the file
  • Step 4: Edit the file
  • Step 5: Find: <title>{if $kbarticle.title}{$kbarticle.title} – {/if}{$pagetitle} – {$companyname}</title>
  • Step 6: Replace this with the following code:
<!-- For product group id cart page -->
{if $smarty.get.gid eq '1'}
<title>Test Meta Title</title>
<meta name="description" content="Test Meta Description">
<meta name="keywords" content="Test, Meta, Keywords">
<link rel="canonical" href="yoururl.com"/>
<meta property="og:title" content="How to Become an SEO Expert (8 Steps)" /> 
<meta property="og:description" content="Get from SEO newbie to SEO pro in 8 simple steps." /> 
<meta property="og:image" content="https://ahrefs.com/blog/wp-content/uploads/2019/12/fb-how-to-become-an-seo-expert.png" />
{else if $smarty.get.gid eq '2'}
<title>Test Meta Title</title>
<meta name="description" content="Test Meta Description">
<meta name="keywords" content="Test, Meta, Keywords">
<link rel="canonical" href="yoururl.com"/>
<meta property="og:title" content="How to Become an SEO Expert (8 Steps)" />
<meta property="og:description" content="Get from SEO newbie to SEO pro in 8 simple steps." />
<meta property="og:image" content="https://ahrefs.com/blog/wp-content/uploads/2019/12/fb-how-to-become-an-seo-expert.png" />
<!-- Similarly you can add meta tags for other product groups -->
<!-- For product id cart pages-->
{else if $smarty.get.pid eq '2'}
<title> Product Title </title>
<meta name="description" content="product id 2">
<meta name="keywords" content="Test, Meta, Keywords">
<link rel="canonical" href="yoururl.com"/>
<meta property="og:title" content="How to Become an SEO Expert (8 Steps)" />
<meta property="og:description" content="Get from SEO newbie to SEO pro in 8 simple steps." />
<meta property="og:image" content="https://ahrefs.com/blog/wp-content/uploads/2019/12/fb-how-to-become-an-seo-expert.png" />
<!-- Similarly you can add meta tags for other products -->
<!-- For Main Announcement page -->
{else if $templatefile eq 'announcements'}
<title>Test Title</title>
<meta name="description" content="Test Meta Description">
<meta name="keywords" content="Test, Meta, Keywords">
<link rel="canonical" href="yoururl.com"/>
<meta property="og:title" content="How to Become an SEO Expert (8 Steps)" />
<meta property="og:description" content="Get from SEO newbie to SEO pro in 8 simple steps." />
<meta property="og:image" content="https://ahrefs.com/blog/wp-content/uploads/2019/12/fb-how-to-become-an-seo-expert.png" />
<!-- For a particular announcement -->
{else if $templatefile eq 'viewannouncement'}
<title>{$title}</title>
<meta name="description" content="Test Meta Description">
<meta name="keywords" content="Test, Meta, Keywords">
<link rel="canonical" href="yoururl.com"/>
<meta property="og:title" content="How to Become an SEO Expert (8 Steps)" />
<meta property="og:description" content="Get from SEO newbie to SEO pro in 8 simple steps." />
<meta property="og:image" content="https://ahrefs.com/blog/wp-content/uploads/2019/12/fb-how-to-become-an-seo-expert.png" />
<!-- For Main Knowledgebase -->
{else if $templatefile eq 'knowledgebase'}
<title>{$title}</title>
<meta name="description" content="Test Meta Description">
<meta name="keywords" content="Test, Meta, Keywords">
<link rel="canonical" href="yoururl.com"/>
{else}
<title>{if $kbarticle.title}{$kbarticle.title} - {/if}{$pagetitle} - {$companyname}</title>
{/if}

Note: The comments mentioned in the above code are just for describing the code breakdown. You can remove that or keep it as it is in the code.

So this is how you can add meta tags and canonical tags to the WHMCS website.

Looking for Something More? We can help!

Our WHMCS experts are ready to accept your custom requirements.