Changing ordering of page title and site name in Joomla

It is good SEO practice to put the page title first in your title tags, and then your site name. Unfortunately, by default, Joomla places the site name first before the page title.

To change this, grab a copy of the file /includes/joomla.php

Around line number 507, replace this:

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

With this:

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

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Posterous
  • StumbleUpon
  • Tumblr
  • Twitter

Tags:

35 Comments:

  1. julz says:

    Thanks, what a co-incidence: this was exactly what I needed to fix. Saved me lots of time!

    - julz

  2. haran says:

    It saved me time. Thanx Chette

  3. Emilio Molé says:

    I´ve been searching how to do this for weeks without any results.
    Thank you! :)

  4. Ivan says:

    Chette, thanks, thanks and thanks four your help… This topic (Changing ordering of page title and site name in Joomla) is just that I needed… You are a fantastic woman… Thanks…

  5. jandrochan says:

    Hola! Era justo lo que andaba buscando. Funciona estupendamente gracias. ;)

  6. dglite says:

    Excellent, helped me a lot, thanks for your help and keep on working for the community!

  7. Juan says:

    Thanks that helps a lot for SEO

  8. Marwen says:

    Thank you very much !

  9. jonn says:

    thanks for your help

  10. Jonathan says:

    Can’t believe I found this!!! Thank you ;D

  11. fifi says:

    oh thanx u!
    i really neede this.. :)

    regards, fifi ;)

  12. Tomelloso says:

    Wow, really great tip, I’m searching some solution for this for my joomla real estate and found this. Thanks for share.

  13. Tony Lindskog says:

    Hi Chette, I just wanted to let you know that I did write the article and gave you kudos and link: http://www.joomlaviews.com/joomla-tutorials/how-to/changing-order-of-site-title-and-page-title-2008032983.html

  14. Tony Lindskog says:

    Thanks for the tip – it is real sad that one needs to hack the source code to get such a basic thing to work.

    I am writing an SEO article for Joomla and I will include this tip as well as a link back for the tip.

  15. LortGob says:

    Thanks, fast and easy!

  16. SEO Expert NZ says:

    Thank you for sharing this information. I will use it for my blog and change the order of title.

  17. wow gold says:

    Thank you for sharing this information. I will use it for my blog and change the order of title. wow gold

  18. tome says:

    Hi Chette, I just wanted to let you know that I did write the article and gave you kudos and linkhttp://www.wow-powerleveling-wow.com/

  19. Deepa says:

    Its great. But in joomla stable version, the path to be changed is in ‘\libraries\joomla\document\document.php’ in that we have a function called ‘setTitle($title)’. The title is actually rendered from there. So you can change title according to your wish

  20. webhosting service says:

    A good article, really helpful

  21. webdesign says:

    Very good ;D

  22. web hosting says:

    thanks for sharing this joomla seo tips,Most cms’ title of joomla is not seo friendly ,like worddpress,hope you can write some thing for wordpress

  23. Deepa said says:

    Its great. But in joomla stable version, the path to be changed is in ‘librariesjoomladocumentdocument.php’ in that we have a function called ‘setTitle($title)’. The title is actually rendered from there. So you can change title according to your wish [url=http://www.wow-powerleveling-wow.com/]wow gold[/url]

  24. josh says:

    hi all! great post but im having some issues, Im using stable version 1.0.13 and using sh404 for seo. The problem is when I edit the code as above I get an error like ”
    SH404SEF : headers were already sent when I got control!
    Killed at line 149 in sef404.php: HEADERS ALREADY SENT (200)
    URL=http://www.tsibatsiba.co.zaoption=com_frontpage&Itemid=42
    OPTION=com_frontpage ”

    any help would be greatly appreciated!

    thanks

    josh

  25. Su says:

    how can i do it in joomla 1.5.10.
    the path u’ve mentioned is available in joomla 1.0..
    here the path is /libraries/joomla/document/document.php
    but what i need to replace instead of line 545.
    function setTitle($title) {
    $this->title = $title;
    pls help.

  26. rost says:

    To answer Su,

    function setTitle($title) {
    $this->title = $title.’putsitenamehere’;
    }

  27. Bailey Button Ugg Boots says:

    [url=http://www.uggboots100.co.uk/classic-tall-romantic-flower-ugg-boots.html]Classic Tall Romantic Flower Ugg Boots[/url]
    Allowing customers to post negative reviews gives credibility to the whole process

  28. wowgold365 says:

    wow gold
    wow gold
    wow gold
    wow gold
    aion kina
    aion kinah
    aion gold

  29. wowgold says:

    Celtics give Rondo $55 million extension.The Boston Celtics and Rajon Rondo(notes) have reached an agreement in principle on a contract extension, Rondo’s agent, Bill Duffy, said [url=http://www.euwowgold.com]wow gold[/url] early Monday.League sources said the extension is for five years and guarantees Rondo at least $55 million.

  30. ugg discount says:

    Very good,thank you very much.

  31. discount ugg boots says:

    good news

  32. IRIS says:

    just do it

  33. ugg store says:

    Yeah,It looks pretty cool.
    Good sharing!

Leave a Reply