How to remove the site name from the title in Joomla

by admin on July 24, 2009 · 0 comments

Create beautiful Joomla websites with a flexible layout from iJoomla.com

I recently realized that every single page created by the default Joomla installation includes the site name in the page title, even before the title of an article itself. This can be both annoying AND harmful to SEO efforts. I looked around for a setting to disable this, but found out that this has to be manually removed in the PHP coding of the CMS itself.

You need to locate the file [install_dir]/includes/joomla.php, and find the function setPageTitle, which should be on line 468.

Change this line:

$this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' – '. $title : $GLOBALS['mosConfig_sitename'];

to

$this->_head['title'] = $title ? $title : $GLOBALS['mosConfig_sitename'];

So now the whole function will look like this:

function setPageTitle( $title=null ) {
        if (@$GLOBALS['mosConfig_pagetitles']) {
                $title = trim( htmlspecialchars( $title ) );
                $this->_head['title'] = $title ? $title : $GLOBALS['mosConfig_sitename'];
        }
}

Create beautiful Joomla websites with a flexible layout from iJoomla.com

Previous post:

Next post: