in Joomla, Tips and Tricks

Adding custom generator tag in joomla

Joomla creates a generator meta tag automatically. If you view source of your joomla site you can search for meta tag “generator”. The default generator tag looks like
<meta name="generator" content="Joomla! 1.5 – Open Source Content Management" />
We can modify this generator tag and also can put option in our custom joomla template to change this meta tag to site name or something different. so let’s start 🙂

In you template index’s file header tag you can write a line like bellow

[code language=”php”]
$this->setGenerator("your custom generator name");
$this->setGenerator(""); // you can leave that as blank too

We can set a option in template

in template index.php file

[code language=”php”]
$myconfig = new JConfig();
$mysitename = $myconfig->sitename;
if($this->params->get(‘removegeneratortag’) == "yes"):
// Remove the generator meta tag

in params.ini file add extra line

in templateDetails.xml file

[code language=”xml”]
<param name="removegeneratortag" type="list" default="yes" label="Remove Joomla Generator Tag" description="Remove or disable joomla generator tag from head tag for security reason">
<option value="yes">Yes</option>
<option value="no">No</option>




you are done. I think now you can add/customize in your own way as you need. If you don’t know how to modify the above code then don’t try 😛

Thank you

Comments are closed.