OpenCart SEO – Custom Title Tag Hack

I actually found a use for the meta keywords tag! Seriously if you want a quick and simple trick to enable you to customise all page titles within Opencart CMS then go into your theme locate the title tag and enter the below:

<title><?php if ($keywords) { echo $keywords; } else { echo $title; } ?></title>

What this bit of simple PHP code will do is output whatever keywords you enter into the meta keywords field. If the field is empty then fallback to the default title tag layout. MAKE SURE your meta keywords field hasn’t been spammed historically or this could spell disaster.

Although this is a simple OpenCart SEO title tag hack as always ensure you take a full backup before changing any theme files.