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
-
Page Title versus H1 title
What's the difference between the Page Title and the H1 title? It seems like both summarize the page. Is it a wasted opportunity to make them the same? Should they be similar but slightly different?
On-Page Optimization | | amybethmegjo1 -
Magento - How to avoid duplicate content on products that span different sites.
We have 4 Magento store fronts that operate out of the same backend. Is there any way to safely have products that span multiple stores without getting a duplicate content penalty? thanks!
On-Page Optimization | | Shop-Sq0 -
Should we add our company's name in page title tag or not?
We have been adding our company (Townscript) name in all the page titles. For example, in an event page of Lucknow Conclave: www.townscript.com/lucknowconclave the page title is Lucknow Conclave | Alexis Society | Townscript I read somewhere that it's not necessary to put your company's name in the title tag. Is it right? Please help!
On-Page Optimization | | sanchitmalik0 -
Duplicate Page Titles in Crawl Errors (although Google is rewriting in serps ??)
Hi Im working on a client/project and crawl report is showing thousands of dupe page titles In the case of the blog/news section its aprox 50 since aprox 50 posts and they all have the same meta-title: "Brand News | Brand" as opposed to: "Title Unique to Page/Topic/KW Relating to Content | Brand" Since these are the main content pages we want to rank (in addition to the main site category pages) then i have instructed dev must prioritise populating these pages meta-titles with the actual post/article titles, as per the latter version of the above example. (I should mention that i have requested they fix all dupe titles but main content pages are the priority). Whilst this will reduce the number of dupe titles in crawl error/warning report which is a good thing, is it actually likely to increase the ranking of these news/content pages given that Google does seem to be rewriting the titles correctly in the serps based on the page content ? Many Thanks in advance for your input
On-Page Optimization | | Dan-Lawrence0 -
Changing of title page and description
Can I ask how long after changing the Title and Description tags on a website do people have to wait to see these changes reflected in Google? I changed a site of mine a couple of weeks back, pinged the site to google and had well over 5,000 googlebots to the page (not a result of pinging, I get that anyway), yet Google continues to display the old listing. Any secret techniques to speeding this up? Thanks
On-Page Optimization | | Grumpy_Carl0 -
Does anyone have any experience with using Altruik for optimizing a retail site?
Greetings - can anyone offer an opinion on the services of http://www.Altruik.com/? They claim to be able to effectively optimize the deep pages of online retailers. I welcome any and all feedback! Eric
On-Page Optimization | | Ericc220 -
Title tag for category page
I’d love some clarification on what would be the best title tag for a shopping category page. The category page is “prams” , the brand is Baby Huddle and the top keywords in order of importance are pushchairs, strollers and buggies. Here are the options I suggest: Buy Prams | Pushchairs, Strollers, Buggies | Baby Huddle Buy the best prams, pushchairs, strollers and buggies on Baby Huddle Buy prams with free delivery and great prices on Baby Huddle
On-Page Optimization | | walidalsaqqaf0 -
Using AJAX to get a meta description to show up
We're unhappy with the meta descriptions google is picking up for our links in SERPs so have started using AJAX to stream in the content google was previously picking up for meta descriptions. This worked and it doesn't seem to have impacted traffic coming to our site, however since the day of that change our bounce rates have gone up significantly, even for pages that we did not push this change to. Is it possible that doing this caused Google to treat our site differently site wide? Is there anything we should be cautious of when doing this? I know the bounce rates could be impacted by users being better prepared by the google meta descriptions, however it doesn't explain what's happening to parts of our site that we didn't do anything to. -Billy
On-Page Optimization | | RealSelf0