Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Renaming The Title Of Individual Pages


  • Please log in to reply
8 replies to this topic

#1 WesMcDermott

WesMcDermott

    HR 2

  • Members
  • PipPip
  • 42 posts
  • Location:Manchester, UK

Posted 06 February 2009 - 08:23 AM

Hey,

I've recently started an seo job on a company website that uses php, and I'm not big on it at all.

At the moment individual pages pull from a template page elsewhere on the site, within the title tag on the template page is <?php echo $title; ?>

Every page on the site at the moment has Welcome 'page name' as the title but I would like to customize each individual page and I have no clue of how to go about it? It's also the same with the meta desciption, and the keyword tags!!

Wes



#2 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 06 February 2009 - 08:55 AM

In those php files that make up each of your pages you can simply reset the $title variable. If you look in the header file that's getting included it probably has a default title set there. You may need to tweak that code a bit too.

Can you grab the code that sets the title in this included page and paste it here? There are several ways they could be doing this, but it should be fairly easy to tweak once we know what they're doing. But still make sure there's always something there.


#3 WesMcDermott

WesMcDermott

    HR 2

  • Members
  • PipPip
  • 42 posts
  • Location:Manchester, UK

Posted 06 February 2009 - 11:13 AM

Hey Randy,

I'm not sure what you actually need to determine how this goes.

I've PM'd you the url of the site if that helps!

Wes

#4 Yoshimi

Yoshimi

    HR 3

  • Active Members
  • PipPipPip
  • 56 posts

Posted 12 February 2009 - 12:24 PM

if you think of <?php echo $title; ?> as a question, somewhere on your server is a file with the answer; you need to find the right PHP file which contains the title variable and change it to reflect what you want your title to say; you may also need to create variations on the variables to create unique page titles. You will need some PHP knowledge to do this, but as someone with basic HTML & CSS skills, I can tell you that with a little trial and error I have managed to work it out in the past biggrin.gif

If you make sure you have good back ups and play around with this for a while you will find out where everything is within the site, and understand the structure much better then if you follwo instructions like "do a, now do b". Have a play around in the code and you will increase the amount you are able to do on this site.

Alternatively, give the client a word doc with your recommendations and instructions on how you would like their developer to implement them.

#5 Nueromancer

Nueromancer

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 301 posts
  • Location:Bedford Uk

Posted 12 February 2009 - 12:30 PM

QUOTE(WesMcDermott @ Feb 12 2009, 05:12 PM) View Post
Hey Randy,

I've still not been able to sort this out, I've posted on seomoz and awaiting a reply. Have you any ideas what I can do maybe?

Thanks,
Wes


Depends it could be a global variable set some where or is there some php code that accessing a database to pull a $title back from a database.

#6 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 12 February 2009 - 01:01 PM

If memory serves (and correct me if I'm remembering this incorrectly Wes) we'd figured out that the site was pulling the <title> information from a database, but couldn't figure out which CMS platform the site was built on. With the idea being that if we could figure out the CMS platform there would probably be a simple plugin one could install to fix the titles without messing up something else.

I also seem to recall you'd found a mainapp.php file, or something close to this filename, that pulled certain information from a database to populate different parts of the pages. eg the page Title, meta keywords, meta description, etc. I believe in that file somewhere it also made reference to a $pageTitle variable that accessed a "pagename" (as in filename) of the page being loaded.

Can you see the database to see those different fields?

If it were me I'd edit one or two of those fields for a single page, then load it in my browser to see what it does. You should be able to see what each edit changes in the page code. For instance, if those pages weren't going to have a long meta description you might be able to re-purpose that database field so that it also became the page <title>. Then change the reference in that mainapp.php file so that the title is getting pulled from the field you want it to be pulling from.

Since it's already pulling from the database that'll be the easiest way to do it if you can. Though it would require someone going through the database for each of the pages to make edits.

#7 WesMcDermott

WesMcDermott

    HR 2

  • Members
  • PipPip
  • 42 posts
  • Location:Manchester, UK

Posted 16 February 2009 - 10:26 AM

QUOTE(Randy @ Feb 12 2009, 06:01 PM) View Post
If memory serves (and correct me if I'm remembering this incorrectly Wes) we'd figured out that the site was pulling the <title> information from a database, but couldn't figure out which CMS platform the site was built on. With the idea being that if we could figure out the CMS platform there would probably be a simple plugin one could install to fix the titles without messing up something else.

I also seem to recall you'd found a mainapp.php file, or something close to this filename, that pulled certain information from a database to populate different parts of the pages. eg the page Title, meta keywords, meta description, etc. I believe in that file somewhere it also made reference to a $pageTitle variable that accessed a "pagename" (as in filename) of the page being loaded.

Can you see the database to see those different fields?

If it were me I'd edit one or two of those fields for a single page, then load it in my browser to see what it does. You should be able to see what each edit changes in the page code. For instance, if those pages weren't going to have a long meta description you might be able to re-purpose that database field so that it also became the page <title>. Then change the reference in that mainapp.php file so that the title is getting pulled from the field you want it to be pulling from.

Since it's already pulling from the database that'll be the easiest way to do it if you can. Though it would require someone going through the database for each of the pages to make edits.


Hi Randy,

Thanks for your help on this one ;-)

I've actually managed to figure it out, go figure! Like you said, it needed the editing of each individual file to include the variables $title = $keyword = etc to overwrite the data pulled from the database.

I'm officially a PHP ninja! Yea rite...Don't think I'll ever be one!

Cheers Randy!

Wes


#8 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 16 February 2009 - 12:12 PM

hysterical.gif Ninja is a relative term Wes.

So you can safely call yourself a PHP Ninja for page titles with the CMS you're working with. And that's all that really matters right now, isn't it? wink1.gif

#9 WesMcDermott

WesMcDermott

    HR 2

  • Members
  • PipPip
  • 42 posts
  • Location:Manchester, UK

Posted 10 March 2009 - 07:14 AM

QUOTE(Randy @ Feb 16 2009, 05:12 PM) View Post
hysterical.gif Ninja is a relative term Wes.

So you can safely call yourself a PHP Ninja for page titles with the CMS you're working with. And that's all that really matters right now, isn't it? wink1.gif


I'm sure it is lol! And beleive me I use it very relatively :-)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

SPAM FREE FORUM!
 
If you are just registering to spam,
don't bother. You will be wasting your
time as your spam will never see the
light of day!