Joomla Title Tag Change - HotThemes

Search Form and Social Buttons

HotThemes Logo and Top Menu

Page title tag <title> is important for search engine optimization of your website. Search engine crawlers will rank your website higher if your target keywords are in the <title> tag.

How to change <title> tag for a page of your Joomla site? When you edit a menu item, under System tab, you'll find Page Title. This will be <title> of the page, no matter if "Show Page Title" option is enabled or disabled.

However, what if you have 1000's of pages and you'd like to have word "ABC Widgets" on <title> tags of all your pages? You should edit your template. Open file index.php of your template (it's in "/templates/template_name" directory). After <head> add the following code:

 
<?php 
$document =& JFactory::getDocument();
$document->setTitle($document->getTitle()." - ABC Widgets");
?>
 

After that, all pages will have <title> tag like: "Your page name - ABC Widgets". However, if default menu item (home page) of your site has title ABC Widgets, it will now become "ABC Widgets - ABC Widgets". This is something you probably don't want, so you can add conditional statements in order to disable altering of <title> tag for home page:

 
<?php 
if (@$_REQUEST['view'] != 'frontpage') {
$document =& JFactory::getDocument();
$document->setTitle($document->getTitle()." - ABC Widgets");
}
?>
 

Finally, if you like word "ABC Widgets" to be before Joomla article title, the code should be like this:

 
<?php 
if (@$_REQUEST['view'] != 'frontpage') {
$document =& JFactory::getDocument();
$document->setTitle("ABC Widgets - ".$document->getTitle());
}
?>
 

Links, Partners and Social Media