Soda Tasting, an online show for those who love soda

Bookmark and Share

Adding Meta Tag Description and Keywords in phpBB 3

Adding Meta Tag Description and Keywords in phpBB 3

Postby Patrick » March 22nd 2009, 11:21 am

Would you like to add meta tags to your phpBB 3? That's what I'm going to discuss in this tutorial.

The two main meta tags that are probably the most requested and talked about are description and keywords. But, if you happen to want to use any other meta tags, it'll be easier enough to add them, once you have read the following.

Introduction

Meta tags are edited and added in the overall_header.html file in your style's template directory. The two default phpBB styles (and the ones that the vast majority of styles are based off of) are prosilver and subsilver2.

For prosilver, the overall_header.html file is located at your main phpBB directory/styles/prosilver/template/overall_header.html. For subsilver2, it would be your main phpBB directory/styles/subsilver2/template/overall_header.html. If you are using a different style, you can find the overall_header.html file in the very same way, just by going to that styles folder rather than prosilver or subsilver2.

Where Do I Find Them?

The meta tags are in the top of the overall_header.html file. For both of the default phpBB 3 styles, they are in the first 13 lines. Here is the first 13 lines of prosilver:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>

<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
<meta name="keywords" content="" />
<meta name="description" content="" />

And here are the first 13 lines of subsilver2:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>

<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="content-language" content="{S_USER_LANG}" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
<meta name="keywords" content="" />
<meta name="description" content="" />

The tags that start with "<meta" are the meta tags and if you look at the final two, you will see the tags for keywords and description. If they aren't there, feel free to take the ones shown here and add them to your style, below whatever meta tags are present. You can add any additional meta tags that you would like, as well.

Please note that meta tags should always be within the opening and closing of the head tag, i.e.:

Code: Select all
<head>
META TAGS MUST GO IN HERE
</head>

The Description Tag

The description tag is generally used as a general description of the website, article, etc. Let's say that we were doing one for the phpBBHacks.com Support Forums. Here is what we might write:

Code: Select all
<meta name="description" content="Friendly, moderated support community dedicated to phpBB, hacks, styles and more." />

Please note that the entire description is within the quotation marks. You want to keep it to below 200 or so characters, generally, as only so much will be indexed and displayed.

The Keywords Tag

The keywords tag is generally used for keywords related to the website, article, etc. Again, let's say that we were doing this for the phpBBHacks.com Support Forums. Here is what we might write:

Code: Select all
<meta name="keywords" content="phpBB, support, forums, hacks, styles, templates, customization, help, community, software, programming" />

You want to keep the keywords relevant to your site and targeted.

Bringing it All Together

So, if we took the two examples above and added them into our prosilver style, here is what the first 13 lines of overall_header.html would look like:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>

<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
<meta name="keywords" content="phpBB, support, forums, hacks, styles, templates, customization, help, community, software, programming" />
<meta name="description" content="Friendly, moderated support community dedicated to phpBB, hacks, styles and more." />

Once we are happy with the edits, the overall_header.html file must be uploaded to it's location on the server and you could clear your cache by going to your admin panel index page and clicking the "Run now" button next to "Purge the cache."

You should now be good to go with your new or adjusted meta tags.

Conclusion

The value of meta tags is debatable. At best, they probably have only a small impact. At worst, they have none. The description tag is still supported in a meaningful way, while the keywords tag is generally considered to be unimportant. This is not my area of expertise, so I would recommend doing your own research, as well as reviewing this article at SearchEngineWatch.com for more.

Thank you for reading.
User avatar
Patrick
Founder
 
Posts: 17427
Joined: May 11th 2001, 7:00 pm
Location: Harbinger, NC, U.S.A.

Return to phpBB 3: Customizing Your phpBB

Who is online

Users browsing this forum: No registered users and 1 guest