SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Please help with <title> problem
-
Aug 7, 2006, 11:35 #1
- Join Date
- Nov 2002
- Posts
- 0
- Mentioned
- 0 Post(s)
- Tagged
- 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 "sitename.com". 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 "sitename.com" So I have thousands of pages that show up as "sitename.com" 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.
-
Aug 7, 2006, 12:46 #2
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
title
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.Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
Bookmarks