Seo

From WHMCS Documentation

Jump to: navigation, search

An assembly of ideas, tips, tricks and hacks to help with SEO in WHMCS.

The key concepts of SEO are Search Engine friendly page titling, meta tags & titles, SEF links, image titles & anchors, and content formatting. These tips & suggestions assume you've already turned on SEF KB, Downloads & Announcements. However, the default "_" spacer is recognised by Google as joining words, whereas a "-" separates words


Page Titles For Knowledgebase, Downloads & Announcements. As this feature is not available on a page by page basis, custom page titles can best be implemented by an addition to the header.tpl file, using {if} statements. For example, insert something similar to the following in your header.tpl, somewhere above </head>

<title>{$companyname} - {$pagetitle}{if $kbcat.name} - {$kbcat.name}{/if}
{if $title} - {$title}{/if}
{if $kbarticle.title} - {$kbarticle.title}{/if}
{if $dlarticle.title}{$dlarticle.title} - {$dlcat.name}{/if}
{if $announcement.title} - {$announcement.title}{/if}{$announcement.text|truncate:200:"..."}</title>
  • Note: the {if} statements are yet to be tested

Meta tags As this feature is not available on a page by page basis, meta tags can best be implemented by an addition to the header.tpl file. For example, insert something similar to the following in your header.tpl, somewhere above </head>

<meta name="description" content="{if $dlarticle.title}{$dlarticle.title} - 
{$dlcat.name} - {$dlcat.description} - {$download.title} - {$download.description} {/if}
{if $kbarticle.title}{$kbcat.name} - {$kbcat.description} - {$kbarticle.title} - 
{$kbarticle.article|truncate:100} - {/if}{if $announcement.title}{$announcement.title}
 - {$announcement.text|truncate:100} - {/if} and insert your other text here" />
  • Note: the {if} statements are yet to be tested

Meta Titles As this feature is not available on a page by page basis, meta title can best be implemented by an addition to the header.tpl file Following the previous suggestion, insert the below above the </head> statement in your header.tpl file.

<meta name="keywords" content="{$pagetitle}{if $title}, {$title}{/if}
{if $kbcat.name}, {$kbcat.name}{/if}{if $kbarticle.title},
{$kbarticle.title}{/if}{if $kbcat.description}, {$kbcat.description}{/if}
{if $dlarticle.title}, {$dlarticle.title}{/if}{if $dlcat.name}, {$dlcat.name}{/if}
{if $announcement.title}, {$announcement.title}{/if},
insert your other keywords, group phrase by comma, to get the right combos" />

Yahoo & Google verify tags Whilst not strickly SEO, these tags are important for using webmaster tools offered by Y & G! Following the previous suggestion, insert the below above the </head> statement in your header.tpl file. <meta name="verify-v1" content="Lyi9xfjhrkjh;kdfjha'hdfa'slkfhaskhdAc=" />

Breadcrumbs In your header file, replace {$breadcrumb} with {$breadcrumb|regex_replace:"/[_]/":"-"} to replace all underscores with hyphens in your breadcrumb navigations.

SEF Urls Since v3.8.1, SEF urls have been implemented in the Downloads, Knowledgebase & Annnouncements sections. in each of the files, you can make some multiple enhancements, including replacing the underscore between words, adding titles to links & images and adding alt tags to images.

Image titles & anchors information to come

Content formatting information to come

Site maps As this feature is not available as of v3.8.1, this can best be implemented by an addition of an external application called from within WHMCS templates

--Zorro67 08:14, 9 January 2009 (UTC)



Page Specific Header and Meta Tags
Modify WHMCS to have the header.tpl called by individual templates rather than WHMCS itself. By doing it this way, each template can feed header.tpl with some customized info. Here is how it is done: (Easy as 1-2-3 .... Only three simple steps)

1) First, we need to disable WHMCS from automatically loading the header.tpl - Maybe in a future update they'll have that has a config setting so that we can decide if we want WHMCS to load it or not. - Since that option has not yet been added, we have to trick WHMCS.... Copy the contents of header.tpl into a new file and call it custom_header.tpl - Now delete everything from header.tpl so it is just a blank file. WHMCS will still load it but since it is empty, nothing will happen.

2) Edit custom_header.tpl which you just created to include your custom header and meta tags. Each tag should specify both a variable that each template can set and a default value in case a template does not set the value.

Example:

<html>
<head>
<title>{$title|default:'$companyname - $pagetitle'}</title>
<meta name="description" content="{$meta_description|default:'Some default text here'}" />
<meta name="abstract" content="{$meta_abstract|default:'Some default text here'}" />
<meta name="keywords" content="{$meta_keywords|default:'Some default text here'}" />
<meta name="author" content="{$meta_author|default:'Joe Author'}" />
<meta name="rating" content="{$meta_rating|default:'General'}" />
<meta name="revisit-after" content="{$meta_revisit|default:'15 days'}" />
<meta name="robots" content="{$meta_robots|default:'index,follow'}" />
</head>
<body>

3) At the top of every template file, load the custom_header.tpl file by including something like the following (obviously customized to the needs of each template)....

{* When calling the custom_header.tpl file, only specify whatever values
that change from the defaults set in custom_header.tpl *}

{include file='custom_header.tpl'
meta_description='Page specific description here'
meta_keywords='Page specific keywords here'
meta_robots='noindex,nofollow'}


--Glenn J. Rowe 17:43, 22 February 2009 (EDT)




Retrieved from "http://wiki.whmcs.com/Seo"