How to remove meta generator in Joomla 1.7 and 2.5?

Post Reply
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

How to remove meta generator in Joomla 1.7 and 2.5?

Post by Saman » Wed Apr 04, 2012 3:52 am

If you view your page source in a Joomla powered site, you will notice that there is a line as below.

Code: Select all

<meta name="generator" content="Joomla! 1.7 - Open Source Content Management" />
OR

Code: Select all

<meta name="generator" content="Joomla! 2.5 - Open Source Content Management" />
It is sometimes required to remove this meta element and here is how you could do that.
  1. Open file /libraries/joomla/document/html/renderer/head.php.
  2. Notice the following line around line number 91 or 92

    Code: Select all

    $buffer .= $tab.'<meta name="generator" content="'.htmlspecialchars($document->getGenerator()).'" />'.$lnEnd;
  3. Comment this out as below,

    Code: Select all

    //$buffer .= $tab.'<meta name="generator" content="'.htmlspecialchars($document->getGenerator()).'" />'.$lnEnd; 
Post Reply

Return to “PHP & MySQL”