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.
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!
April 26th, 2007 at 3:11 pm
[...] 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 [...]
May 4th, 2007 at 6:00 am
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.
May 4th, 2007 at 11:31 am
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
May 8th, 2007 at 10:39 pm
Hi there,
I’m stew new to surfing and the net.
May 8th, 2007 at 10:53 pm
Hey stew - Are you planning on setting up your own website? I hope this blog is useful for you.
May 11th, 2007 at 1:40 am
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.
May 11th, 2007 at 12:15 pm
Grrr those darn plagiarists, eh?!? I hope this article was still useful for you though.
May 17th, 2007 at 12:08 pm
Thank you so much for this tip! I have been looking for something like this for awhile now and this was the perfect solution!
May 17th, 2007 at 12:14 pm
Thanks for visiting the blog! I am glad the article was useful to you, and hope you become a regular reader
May 25th, 2007 at 8:57 pm
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.
May 25th, 2007 at 9:40 pm
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.
July 22nd, 2007 at 9:14 pm
this article is good . I’ve tried it on my website forum. it’s really work. thanks.
July 22nd, 2007 at 9:27 pm
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.
August 5th, 2007 at 2:36 am
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.
August 5th, 2007 at 5:06 am
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!
August 8th, 2007 at 1:27 pm
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!
August 16th, 2007 at 8:09 pm
Hi, Martin
i am using phpbb3 , i hope you will update this helpful information.
Thanks
August 16th, 2007 at 10:41 pm
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!
August 21st, 2007 at 9:11 pm
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.
August 22nd, 2007 at 12:15 pm
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.
August 24th, 2007 at 10:58 pm
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
August 25th, 2007 at 12:47 pm
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?
October 1st, 2007 at 11:45 pm
It’s very helpfull article article in term of seo optimization, good work Martin.
October 3rd, 2007 at 8:22 pm
abbigliamento - Thanks, I am glad you found the article helpful. Are you running phpBB on any of your websites?
January 16th, 2008 at 12:25 am
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.
January 18th, 2008 at 5:32 pm
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?
February 12th, 2008 at 3:43 pm
We’re using a phpBB SEO package, which works very well for us.
February 15th, 2008 at 3:29 pm
Eric - Thanks for the heads-up; I’ll be sure to take a look when I start the process of investigating phpBB3.
February 21st, 2008 at 12:35 am
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.
February 21st, 2008 at 4:41 am
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 ?
February 22nd, 2008 at 7:20 pm
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?
February 22nd, 2008 at 9:37 pm
Okie dokie Martin, I’ll re-check again
Cheers for the reply.
March 16th, 2008 at 11:06 am
Great article, helped me to take away those unnecesary words in the pages titles!
March 17th, 2008 at 7:25 pm
Guillermo - Happy to help
March 18th, 2008 at 2:14 am
Thankyou! This is exactly what I was looking for and helps my site so much better now.
March 19th, 2008 at 7:33 pm
Chic - I am glad to have helped.
March 30th, 2008 at 10:50 pm
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.
April 2nd, 2008 at 12:51 pm
Zorocke - Thanks for your comment; welcome to Community Spark!