6

I have a Joomla 2.5 website and I would like to remove the page/menu name from appearing in the title so it does not display in Google or the browser tab. Currently the homepage is appending 'HOME' to the page title i.e:

<title>Example Sitename - Page/Menu Name</title>

I know that the "Browser Page Title" can be found within "Page Display Options", but if I leave it empty, it uses the Menu Item Title.

Please note that I only want to remove the page/menu name on the front page of site, also the solution should be working for bilingual (or multilingual) websites, that means "My Website - Home" will be "My Website" and other languages will follow the same rule, i.e. "Mon Website - Accueil" will be "Mon Website".

1
  • 1
    Does anyone know if this has an option for Joomla 3x TY
    – landed
    Jun 7, 2017 at 14:08

7 Answers 7

3

The only solution I found until now (Joomla 3.0) is adding the following snippet in your template's index.php file before <jdoc:include type="head" />.

The snippet for my page looks like this:

<?php
if (!strncmp($this->getTitle(), "Home", 4))
{
  $app = JFactory::getApplication();
  $this->setTitle( $app->getCfg( 'sitename' ) );  
}
?>

This basically is a hack that replaces the title if it begins with "Home".

2
  • What about Joomla 2.5.8?... Jan 25, 2013 at 17:11
  • Doesn't work for earlier version of Joomla :/ Mar 10, 2013 at 17:54
3

To do this in Joomla 2.5 do the following steps:

  • Login to the Joomla backend using your administrator account
    • Click menu manager
      • Click Main Menu
        • Click on Home and take note of the menu ID.

Then add the following code to template's index.php file, before <jdoc:include type="head" /> (note that in the example below, 101 should be replaced with the actual ID number on your site as mentioned in the steps above.

<?php
    $menuItemId = JRequest::getInt('Itemid');
    if ($menuItemId == 101) $this->setTitle('');
?>

If you want a custom title, e.g. My Custom Title, then use:

  • $this->setTitle('My Custom Title');

I have not tested this on a multilingual website, but assuming each language has its own home page, you would just test for all home pages, using their unique menu item ids.

2
  • Thanks for replying, I m gonna try it. Is this gonna change the way Google shows the title of my website too? Dec 9, 2013 at 19:24
  • It works for a monolingual website. Even though doesn't replies exactly what my question stated, helped me to find the the right answer for the bilingual website. Jan 29, 2014 at 19:18
2

As George Okello said, you have to notice the First page's Id. Go to Menu Manager and find them out for each language. There must be a different configuration if you have a plugin for multilingual websites.

in my case both ids were 127 and 128. So the solution is to put the following code before the <jdoc:include type="head" />.

<?php
  $menuItemId = JRequest::getInt('Itemid');
  if ($menuItemId == 127) : $this->setTitle('Theater of the Deaf of Greece');
  elseif ($menuItemId == 128) : $this->setTitle('Θέατρο Κωφών Ελλάδος');
  endif;
?>

Now if you have a multilingual website, all you have to do is to copy the line elseif ($menuItemId == xx ) : $this->setTitle('xxxx'); and paste it before the endif; for as many languages (or pages with unique id's) you wish.

1

I strongly recommend installing AceSEF or SH404SEF within Joomla. AceSEF is free and does the job while SH404SEF tends to have slightly more features but comes a price. Joomla SEO is ok out of the box but its far from perfect, altering templates is ok but using an extension is far easier and does more SEO than just what you asked.

These plugins can be installed on all versions of Joomla:

  • Joomla 1.5
  • Joomla 2.5
  • Joomla 3.0
  • Joomla 3.5 and above...
0

Make sure "Show Page Heading" is set to No under Page Display Options for the Home menu item. That will hide the title as long as you have also set "Show Title" to Hide under Article options of the same menu item.

2
  • 1
    Does not work for me.. my home page is a "category blog" and even if I additionally set "Category Title" to Hide under "Category Options" the page still says "Home - ..."
    – Tarnschaf
    Dec 12, 2012 at 16:58
  • @Trev yeaaah, Tarnschaf is right.. If i put show page heading to no, then it removes my h1 tag I have set with the entry "Page Heading" into the page. What I need is that my 'Browser title is set to blank and later it won't pick a title from my 'Menu title'.. Jan 25, 2013 at 17:08
0
    <?php
        $title = $this->getTitle();
        $app = JFactory::getApplication();
        //$this->setTitle( $title . ' - ' . $app->getCfg( 'sitename' ) );
        $this->setTitle( 'your funky title' );
    ?>

It is all in here

Try adding if(str_pos($this->getTitle(), "Part of your home page title")!=false)

2
  • I have the feeling that you didn't read or understand my question.. Mar 10, 2013 at 17:48
  • system didn't let edit my commend so I continue here: I especially wrote: 'I want this omission of browser page title only for the home page.' Your solution only partially works.. Thanks anyway. Mar 10, 2013 at 17:58
0

The Joomla plugin called Title Manager can handle this for you. Simply use:

  • Only show site name on home page: Yes
1
  • Thanks for informing me about it. Does this affects also how Google shows the website title? Dec 9, 2013 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.