Adding keywords to your BANS site title

February 11, 2008 – 7:40 pm

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.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • del.icio.us
  • DZone
  • Technorati
A few more you might be interested in:
  1. One Response to “Adding keywords to your BANS site title”

  2. Thanks for the tips, worked well :)

    By Jerry on Apr 10, 2008

Post a Comment