Online Communities | Articles

1st April, 2007 | Community Development | By Martin Reed - Community Manager

How to optimise page titles in phpBB

As you may be aware, the standard title structure in phpBB forums is as follows:

Site Name :: View topic – Topic Title

So for example:

Just Chat :: View topic – Borat movie review

This isn’t particularly good for search engine rankings – they place considerable importance on the titles of your pages. Having your site name as the first part of your title means the actual title of the topic drops in importance. The additional inclusion of the phrase ‘View topic’ on each page further dilutes the quality of your titles.

A far better way of having your titles appear (using the example I gave above), would be:

Borat movie review : Just Chat

This places the actual topic being discussed right at the front of the page’s title and as a result, the search engines will rank that phrase more highly compared to if it was tagged on at the end.

It is pretty easy to make this change in phpBB, and I will show you the steps to take below.

Before editing any of your files, ensure you make backup copies in case anything goes wrong – I will not be held responsible for any loss of files or data.

**

1) Open the file ‘templates/subSilver/overall_header.tpl’

At around line 8, you will see the following line:

<title>{SITENAME} :: {PAGE_TITLE}</title>

Replace this with the following line:

<title>{PAGE_TITLE} : {SITENAME}</title>

(This makes the name of the thread / category appear before your site name in the page title)

2) Open the file ‘viewforum.php’ in the root of your forum

At around line 390, you will see the following line:

$page_title = $lang['View_forum'] . ‘ – ‘ . $forum_row['forum_name'];

Replace this with the following line:

$page_title = $forum_row['forum_name'];

(This removes the irrelevant phrase ‘View topic’ in the page title shown when a user views a specific forum / category)

3) Open the file ‘viewtopic.php’ in the root of your forum

At around line 577, you will see the following line:

$page_title = $lang['View_topic'] .’ – ‘ . $topic_title;

Replace this with the following line:

$page_title = $topic_title;

(This removes the irrelevant phrase ‘View topic’ in the page title shown when a user views a specific thread)

You can now decide whether to go a step further and optimise the title shown on the index page of your forum:

4) Open the file language’/lang_english/lang_main.php’

At around line 206, you will see the following line:

$lang['Index'] = ‘Index’;

This is what makes the word ‘Index’ appear on the front page of your forum. You can change this to something more relevant to your site – perhaps add a couple of keywords, so it reads as (using earlier examples):

$lang['Index'] = ‘Chat at Just Chat’;

If you are wondering how to change the name of your forum, that can be done by logging into your admin panel.

That’s it! Let me know how you get on.


More community building articles:

Previous (Older) Article: Common email newsletter mistakes

Next (Newer) Article: Using suspense to promote interaction



Related Articles



This blog is link loved enabled - the no follow attribute has been removed from all links that appear in comments so make a contribution and earn yourself some link love!

If you enjoyed this post, make sure you subscribe to the full RSS feed or subscribe via email to have new articles delivered direct to your inbox!

49 Responses to “How to optimise page titles in phpBB”

  1. Don’t obsess about search engines » Community Spark Says:

    [...] a recent article, I wrote about how to optimise page titles in phpBB. Apart from this, and adding relevant headers and meta tags to my pages I have done very little [...]

  2. Aron Says:

    Hi Martin,
    May I know how to display the topic of latest thread on index page. It only display the info of latest user who post thread at the Last Post section. Is it possible to display the topic of latest thread with user’s info? It seems a lot of forums can do it.

  3. Martin Reed Says:

    Hi Aron – welcome to the blog, and thank you for your comment.

    If you do a search on Google or phpBBhacks you should be able to find something that does this.

    I done a little search for you, is this what you are looking for?

    http://www.phpbbhacks.com/download/566

  4. stewyoume Says:

    Hi there,

    I’m stew new to surfing and the net.

  5. Martin Reed Says:

    Hey stew – Are you planning on setting up your own website? I hope this blog is useful for you.

  6. Yogesh Says:

    Good that you put this up, had gotten the same info on DP regarding how to do this. I guess that person might have read about it from here.

  7. Martin Reed Says:

    Grrr those darn plagiarists, eh?!? I hope this article was still useful for you though.

  8. DanaRVT Says:

    Thank you so much for this tip! I have been looking for something like this for awhile now and this was the perfect solution!

  9. Martin Reed Says:

    Thanks for visiting the blog! I am glad the article was useful to you, and hope you become a regular reader :)

  10. Del Says:

    Thank you.

    This was just what i was looking for.

    I am also looking for the htaccess rules for rewriting the URLs to make them a little more benefitial to the search engines, can you help with this?

    Thanks again.

  11. Martin Reed Says:

    Hi Del. I am glad this article was helpful for you.

    I am not a coding expert, so would not like to recommend specific actions on how to rewrite URLs with .htaccess.

    I would recommend you do some searches over at phpbb.com and on Google as I have seen many hacks and tips in the past that may be what you are looking for.

  12. Naeem Says:

    this article is good . I’ve tried it on my website forum. it’s really work. thanks.

  13. Martin Reed - Blog Author Says:

    Nareem – I am glad you enjoyed the article and that you have successfully implemented these changes on your forum. Good luck with the continued development of your community.

  14. Sperge Says:

    Martin, I used your techniques on the phpbb2 version of my board and it worked beautifully – belated thanks.

    I have recently upgraded to phpbb3 and have already done some page title optimisation but I haven’t yet been able to optimise the index page title.

    On the old board, this was controlled by the variable $lang[’Index’] in lang_main.php

    Any idea where to find the equivalent in phpbb3? Thanks.

  15. Smiley Says:

    I still can’t bloody delete the view topic thing. Everytime I delete the said code, the page title also disappears with it lol, still playing around with it though!

  16. Martin Reed - Blog Author Says:

    Sperge – I haven’t a clue when it comes to phpbb3 – I believe it is still only a release candidate; therefore it is not recommended to have it installed in a live environment.

    Smiley – I have no clue why you are having such difficulties. Only delete/edit the portions I mention – not entire lines!

  17. Leandar Says:

    Hi, Martin

    i am using phpbb3 , i hope you will update this helpful information.

    Thanks

  18. Martin Reed - Blog Author Says:

    Leandar – As I mentioned to Sperge, phpBB3 is not currently a stable release, therefore I don’t want to publish any hacks. Besides, I am unfamiliar with its code anyway!

  19. Sperge Says:

    Martin, for your info, phpBB3 is currently at Release Candidate 4 and the Gold release is expected any day now. Strictly speaking, a Release Candidate is still not a stable release, as you say, but it’s now very, very close to it.

  20. Martin Reed - Blog Author Says:

    Sperge – A release candidate is not considered a stable release; that’s why I don’t have it installed, and why I don’t want to offer advice on any hacks for that version.

    Even when the stable release is launched, I will hold off from upgrading until the majority of the inevitable bugs are fixed.

  21. Flybeers Says:

    Hi there,
    finally a breath of fresh air here. I was hoping someone here can point me in the right direction of some kind of good quality live development, motivational seminar? The ones I have seen are just way to expensive, so maybe you have some alternative suggestions. Thanks
    Flybeers

  22. Martin Reed - Blog Author Says:

    Flybeers – Thanks for your kind comment. Can you be a bit more specific about what you are looking for? Are you after a live event seminar or an online Webinar? What subject are you looking for? Are you looking for something purely motivational?

  23. abbigliamento Says:

    It’s very helpfull article article in term of seo optimization, good work Martin.

  24. Martin Reed - Blog Author Says:

    abbigliamento – Thanks, I am glad you found the article helpful. Are you running phpBB on any of your websites?

  25. jonathon Says:

    thank you, very useful information, i was just searching google looking for just this, but does anyone know how to keep the forum name not ~ ********** ****** all the other pages work apart from each forum index, thanks.

  26. Martin Reed - Blog Author Says:

    jonathon – I’m sorry, I don’t understand your question. Do you want the title to simply show your site name on every page as opposed to the topic/category name?

  27. Eric Martindale Says:

    We’re using a phpBB SEO package, which works very well for us.

  28. Martin Reed - Blog Author Says:

    Eric – Thanks for the heads-up; I’ll be sure to take a look when I start the process of investigating phpBB3.

  29. Loui Says:

    Hi Martin

    Have made changes to session ID’s but will also use the code you have provided, thank you very much for providing it and all the other informative information presented – an excellent site.

  30. Loui Says:

    Hi again

    Ive made all the changes to the files, have checked changes a number of times for correctness and can find no fault, could you please have a look at my site Martin and see if any changes have taken place ? (I cannot see any) Got me miffed ?

  31. Martin Reed - Blog Author Says:

    Loui – If you follow the directions, the page titles should be optimised. This only works with phpBB2.x, not the latest phpBB3. Perhaps you missed a line of code or didn’t save a file after editing?

  32. Loui Says:

    Okie dokie Martin, I’ll re-check again :) Cheers for the reply.

  33. Guillermo Says:

    Great article, helped me to take away those unnecesary words in the pages titles!

  34. Martin Reed - Blog Author Says:

    Guillermo – Happy to help :)

  35. Chic Desire Says:

    Thankyou! This is exactly what I was looking for and helps my site so much better now.

  36. Martin Reed - Blog Author Says:

    Chic – I am glad to have helped.

  37. zorocke Says:

    Thank you for this. I am going to implement this as soon as possible. Ha, I and i want to say that i really love your blog. It has been a great help to me.

  38. Martin Reed - Blog Author Says:

    Zorocke – Thanks for your comment; welcome to Community Spark!

  39. Jamie Says:

    Great tip for optimising. It is always better to have key words and titles come up first. I am glad you found a way to get rid of “view topic.” That should help a lot in search engines recognizing and bringing up more relevant sites.

  40. Martin Reed - Blog Author Says:

    Jamie – Thanks for your comment; I hope to upgrade to phpBB3 soon and will post a new article for that version.

  41. Weasel Says:

    If anybody still cares about how to modify page titles in phpBB3 — there is a function called page_header() which sets the PAGE_TITLE. The solution is in the files mentioned in the article above, but in page_header() calls.
    Regards.

  42. Martin Reed - Blog Author Says:

    Weasel – Thanks for the advice; I still haven’t moved over to phpBB 3 so I am sure that will help some readers.

  43. Jeremy Says:

    Outstanding Article! I’d always hated the page titles, but I’d never looked into a mod to change them. If only I’d known it was this easy… I just did this mod for phpBB3, so I’ll give a few pointers that would have sped things up for me.

    You still change the viewtopic.php and viewforum.php files, as mentioned above, but you have to change the page_header() calls instead, as Weasel mentioned ( THANKS Weasel! ).
    Before: page_header($user->lang['VIEW_FORUM'] . ‘ – ‘ . $forum_data['forum_name']);
    After: page_header($forum_data['forum_name']);
    &
    Before: page_header($user->lang['VIEW_TOPIC'] .’ – ‘ . $topic_data['topic_title']);
    After: page_header($topic_data['topic_title']);

    The language file to edit is totally different in phpBB3. You need to go to forum/language/en/common.php
    Before: ‘INDEX’ => ‘Index page’,
    After: ‘INDEX’ => ‘New Title’,

    Hope it’s okay that I posted this here. This really helped me out, so I wanted to share with others, too. Please let me know if I’ve made any mistakes. This seems to be working fine for me, though.

  44. Martin Reed - Blog Author Says:

    Jeremy – Thanks for the update; that certainly helps bring this article back up to date :)

  45. Mark Says:

    I have tried the phpBB3 mods by Jeremy and they work perfectly! Thanks for the valuable info. I suppose I now need to make a new XML sitemap and resubmit it to Google and see what they make of the changes.

  46. Edward Says:

    Is the number of words in the title an issue? For example, should you take out things like “View topic”?

  47. Fred Says:

    Have you tried this: “phpBB3 SEO Advanced mod Rewrite” from phpbb3-seo website? It looks like doing the job,no?

  48. Martin Reed - Blog Author Says:

    Fred – Sounds like it could well do. Please bear in mind, this is an old article and refers to version 2.x of phpBB.

  49. Rob Cubbon Says:

    Thanks a lot. I did 3 of the 4 recommendations. Could not find language’/lang_english/lang_main.php in my phpBB3 files. Just like with blogs it’s good to put blog post titles before site titles I’m sure it’s good to put topic and forum titles before board titles. Thanks!

Please add your comments using the form below.
You can upload an avatar to go with your comments at Gravatar.com (Optional).

Subscribe to Community Spark by RSS or email so you don't miss any community building articles