If you've followed our WHMCS custom pages guide you'll notice that by default they will not allow you to define a custom page title, meta description & meta tags. In this tutorial you'll learn how to add this functionality to any pages you create.

As an example let's say you create a custom page named custom.php.

Open the following file (contains the SEO functions):

/templates/your_template/includes/functions-seo.tpl

You can use the following code as a base for custom pages:

{elseif $filename eq "custom"}
	<title>Page title goes here</title>
	<meta name="description" content="Meta description goes here" />
	<meta name="keywords" content="Meta, tags, go, here" />

Note the custom reference, replace this with the filename of the custom page you created without the .php extension. e.g:

custom.php = custom (as seen above)
custom-hosting.php = custom-hosting

Once you've edited the page reference and added your page title, meta description & meta tags paste the code between lines 11 & 13 of the functions-seo.php file.

Save the file and re-load the page and you should now see the SEO functions applied.

Comments

If you have any questions please leave a comment below or contact our support.