SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Nov 2002
    0 Post(s)
    0 Thread(s)

    Please help with <title> problem

    I'm having a problem with my page title. The title is the same for every page, basically "". That is how it appears in the header.php file.

    In looking at the source code, I also see the original programmer used javascript to make the title in the title bar show the "document.title", which matches the h1 tag for that page. It works perfectly in the title bar of the browser. BUT

    The problem: Search engines see only the title as it appears in the header.php file, which is simply "" So I have thousands of pages that show up as "" in the search engine results. Obviously, I'd like to have each page individually titled in the search engines. I'm sorry I am not a programmer but I think I need a javascript code that I can include in the header file, which will ask the title to be the same as the page "document.title" for that page. The original programmer moved on to bigger clients and will no longer work on this site. If anyone can help with the code for this I would appreciate it.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    West Springfield, Massachusetts
    198 Post(s)
    3 Thread(s)


    The problem is javascript is client-side, so browsers that have javascript enabled will see the change. Bots don't have javascript enabled.
    If you have a server-side script (got PHP?) do something similar to what the javascript is doing you'll be OK, other than that you'll have to "hard code" the title into each page.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts