migrate

phone usa +18456662567

phone uk +448726142710

Contact us on Skype gwsgroup | hangouts gws.desk       

Removing the Joomla Meta tag

A common request from Joomla users is the ability to remove the generator meta tag from the source output of the site. This is usually for security reasons to make it less obvious that the site is running Joomla. The generator value is really easy to modify and remove with one line of PHP code.

Use your favourite editor or open up with ftp your template's index.php file of the default template on your site. Most templates should have a block of PHP at the top of the file starting with <?php and closing with ?>. Find this block and just before the closing PHP brace, insert the following lines of code:

// Remove the generator meta tag
$this->setGenerator(null);
?>

What you do here is to tell the template (that's what $this is) to set the value of the meta generator tag (that's what setGenerator does) to nothing (that's what null means). When you do this, refresh your web page and view the source of the output. Scan down from the top of the file to find the meta generator tag.

  <meta name="generator" content="" />

You can see it's obviously still there but the value is empty, giving you no clues as to what CMS is running the web site. Nothing is probably the safest value, but you could set it to anything you like if you really wanted to.

If you want to be a little 'naughty' you can set this to

// Remove the generator meta tag
$this->setGenerator('www.gws-desk.com');
?>
Submit to DeliciousSubmit to DiggSubmit to FacebookSubmit to Google BookmarksSubmit to StumbleuponSubmit to TechnoratiSubmit to TwitterSubmit to LinkedIn