Open/Close


Adding keywords to your BANS site title

December 31st, 2007 by Robert

A fairly well known SEO technique is to have a good title for each of your pages. Another common tactic is to put keywords in your title as well. Given this, if you have a BANS site, it can be beneficial to automatically add in your page’s keywords to your page title. This is pretty easy to do if you don’t mind editing PHP code.

NOTE: First make sure you backup any files before trying this!

Step One

Open your FrontControl.php file and around line 106 there will be a function called meta. This is where, appropriately enough, the meta section of the HTML page is created.

Step Two

The first part of this section you will see where the title is output. It will look something like:

$f = "<title>".$this->getPageArea("title",$checkFile,"id")."</title>";

Change this to:

$f = "<title>".$this->getPageArea("title",$checkFile,"id")." ".
$this->getPageArea("keywords",$checkFile,"id")."</title>";

But it needs to be on one line. I had to put it on two lines to get it to fit.

Step Three

Now scroll down to about line 182 or so and you will see the follow:

$f .= "</title>";

Right before that, add this line:

$f .= $this->keywords;

That should append the keywords that you specify in your admin section to the title for that particular page. If you have any problems, let me know.

Site5 $5 Hosting Deal

Like what you read? Don't miss anything, subscribe by RSSl!

Share this post:
  • StumbleUpon
  • SphereIt
  • del.icio.us
  • Digg
  • Facebook
  • Reddit
A few more you might be interested in:
  • Adding a sitemap to a BANS site
  • eBay partner network is live as promised
  • Getting closer to a release
  • Second Commission Junction Check
  • Building a better niche store


  • 2 Responses to “Adding keywords to your BANS site title”

    1. 1

      Jay Says

      Sweet! I was wondering how to do this. My experience has been in building static sites and I am just getting into learning php. I had this functionality in a WordPress site that I built and was wondering how to get it into my BANS sites. This was quick and easy - although the line numbers were a little off in Dreamweaver and the code for the second part is a little different. It was still easy to implement - took about five minutes. Thanks again.

    2. 2

      Robert Says

      You are very welcome Jay! I actually got the idea from a wordpress plugin that I have on a couple blogs.

    Leave a Response