How do I get rid of duplicate page titles when using a php site?
-
Hi. I have an e-commerce site that sells a list of products. The list is divided into categories and then those categories for the various pages on the site. An example of a page title. would be given root/products.php?c=40 another page would be given root/products.php?c=41
Is there a way to structure the site with SEO in mind?
-
The variable C probably calls the product up from the database. It's going to pull the product details (include the name of the product) into several variables, then post those variables into the HTML where necessary.
If you can get into the PHP file where the product page HTML is generated, look for the same HTML element the product name is populated into in the source. Hopefully it's as simple as an H1 tag.
There you should find the variable that will contain the product name - something like the following:
If you find the above, you can simply grab that PHP code (everything inside the H1 tags) and paste it right into your <title>tag. </p> <p>Often it's that simple. </p> <p>But if you're using an eCommerce platform, as Don noted - Oscommerce or similar - you want to be careful about making custom tweaks to the PHP files, as this will create issues when you attempt to upgrade to a later version or otherwise patch your installation. In this case, you really want to find a plug-in or other modification that will be upgrade-friendly. </p></title>
-
I know many e-commerce platforms have modifications for this. If by chance you're using Oscommerce or OscMax then you shouldn't have an issue finding an appropriate add-on.
From my personal experience, while this is certainly an SEO related issue, the answers are best provided by the software or platform you're running. For example Oscommerce uses a URL re-write to deal with this and provides you the ability to modify the specific title and meta data.
Hope this helps,
Don
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
SEO Moz Says I have Multiple Page Title Elements
I am getting this recommendation from page grader. I recently added Yoast to my site. Can you confirm that I really have multiple title tags because my seo guy says it is fine and it is just a problem with the crawl. I think I see it on line 18 and line 125 am I correct? urbanforestprofessionals.com
On-Page Optimization | | lehcherry0 -
Duplicated page titles
Dear friends, We have a problem which occurs on our page with duplicated page titles. Landlords are posting rooms on our page and most of them are giving the same name to the rooms and after that, we are getting more and more duplicated page titles. We are applying random whit this title tag: Accommodation for students in {city.name}: {name}. English title
On-Page Optimization | | Eurasmus.com
Certified student rooms in {city.name}: {name} English title
Erasmus room for students in {city.name} | {name} English title
Student room in {city.name}: {name} English title Also our title tag is sometimes to long but there is no possibility to make them shorter. I think. If anyone would have some idea be free to comment and help us. Kind regards Miško Macolić Tomičić0 -
How to optimize WordPress Pages with Duplicate Page Content?
I found the non WWW ans WWW duplicate pages URL only, more than thousand pages.
On-Page Optimization | | eigital0 -
Different Title Tag and Page Headline
My editorial team won't budge with their headlines which are excruciatingly vague ... But I have managed to convince them to let me optimize the title tags and the URLs. Is this sub-optimal or are there some benefits to having a title tag that varies from the page headline or what our dev team calls the "reader friendly" title? For example... Their headline: Increase Your Retirement by 20% with This Safe, Simple Strategy My title tag: Compound Returns: How to Increase Your Retirement 20% Thanks for the help, E
On-Page Optimization | | essdee0 -
How should we handle ecommerce section pages (flagged with duplication) containing the same products?
We've removed a ton of errors, duplication and other stuff since signing up to SEOmoz Pro, but we're getting to the point where what we have left isn't that easy to fix. On one of our (ecommerce) sites we have several sections where people buy products that are applicable to the area of the home. In one or two instances, a particular list of products is the same for two or more different areas - for instance the "Bedroom and Landings" and "Hallway and Stairs" sections may list the same 10 products. This is obviously flagging up as duplication in our reports. What is the best way to handle this situation? Make the one with the highest authority canonical? Point both to another canonical page? Or, try and convince the product department that we should have a more generically name section that both link to? Thanks for any advice!
On-Page Optimization | | Safelincs0 -
Optimize Page Title - Advice
I am currently going through my site and re-doing the page titles to try and optimize each specific product's page. I know that having the part number as the first piece of text in the title is the best practice. My question is, if i add a bunch of terms to the title, after the part number, is that taking away from the important part (the product number)? For example, my product is Audi A4. The term i want to optimize for is Audi A4. Which would be the better title for ranking purposes? A) Audi A4 | Automobile or B) Audi A4 | Automobile | 4 Cylinder | Made in Germany Thanks for the advice!
On-Page Optimization | | Prime851 -
Finding unique title tags for each media coverage page
We have multiple pages for our media coverage, and each page has the same title tag. I know it's important to have unique title tags, but if each page is just a listing of your media coverage (page 1 of 9, page 2 of 9, etc) then how do you create unique title tags for each media coverage page?
On-Page Optimization | | msakakibara0