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
-
Classified ads site and thin content + titles
Hello, i have two questions. Issue 1 is that we are a classified ads site. I started thinking, analyzing why im not ranking even tho i have a lot more content than others and my backlink profile is also better. Googling the advertisements i see that 95% of it is duplicate content. People usually who advertise, add the same add to 10 maybe 30 sites. For google this is duplicate content. Any ideas what to do? I can manually edit ads, to write a bit of unique content, but that is not a long term startegy. Question 2: My titles are all the same - Unique Name - Keyword im trying to rank for. There is around 1000 of such pages. Should i mix the titles up or it is still better to have 1 keyword which will help me to rank?
On-Page Optimization | | advertisingcloud0 -
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 -
Using content for cliche' terms, or content found on other sites
howdy, I have a basic question about using content found on other websites for your own use. I have started a pick up lines website for guys to search for pickup lines to use on girls. Anyways, my website has many, if anything a lot, of the same exact pick up lines as all my competitors are using. If I use the same pick up lines found on their site could i be penalized for this as far as SEO? thanks and hope to hear back
On-Page Optimization | | david3050 -
SEO Moz crawl has 3 missing page title errors when they are clearly there.
My SEO Moz crawl today has highlighted for errors where page titles are empty missing. For example: http://www.musicliveuk.com/live-acts/hire-wedding-entertainment/wedding-entertainment-kent This page clearly has a title as do the other 3. Is it a bug in the system or am I missing something?
On-Page Optimization | | SamCUK0 -
Should I use a Page Name variable after the ? for a dynamic web page
I'm converting for static to dynamic web pages. It appears that the page name is used for page ranking in the search engines. Will adding a Page Name variable help to increase our SEO. For example aspecialgift.com/subcat.php?PageName=GiftPage&ProductID=ABCDE. Does the page name variable make a difference?
On-Page Optimization | | NCBob0 -
PageRank: Links on menu and footer to the same page, does it get counted twice?
Hello all. If I have 10 links on a menu linking to 10 different pages, and 10 links on the footer linking to the same pages, does PageRank get divided by 10 or 20?
On-Page Optimization | | MiamiWebCompany0 -
Potential Duplicate Title Tags On Sibling Pages
Edit I'll take the fall on this one, seems I could have asked my quesiton in a more clear manner. I was cruising other questions and finding a whole of answers that I suspect were not truly intended to help, but maybe help and earn Mozpoints. Wasn't fair of me to label those answering here with that. I will work better on the wording of my questions! 🙂 Edit Either I am asking my question poorly or I am learning there may be a rush to get points by throwing up any old answer...it very well may be the former which I am open to feedback on. Each page is to stand alone and hopefully rank well for the neighbourhood name and in conjunction with another relevant keyword phrase. There is no 'duplicate' version of any pages. * On a site there are numerous pages that provide real estate listings broken down by neighbourhood. Each containing similar content, a abbreviated version of the listings, often spanning 2 or 3 pages. These are 3rd level pages. Properties->Calgary Neighbourhoods->Evanston The title tags created are: Evanston Homes For Sale - NW Calgary Real Estate Panorama Hills Home For Sale - NW Calgary Real Estate Etc. for about 15 or so pages. Then they start again for another area of the city: Sagewood Homes For Sale - Airdrie Real Estate Woodside Homes For Sale - Airdrie Real Estate At this point there is no text on the actual page outside of the listings...an example of similar listings on another site - http://www.experiencerealtygroup.com/BaturynandDunluceHomes.ubr Do you think the SE's will see these as 'proper' use of the Title Tag or duplicate or other practices they tend to frown upon? It is a logical way of creating the title and obviously creating a unique version for each page would not only be tough to scale on some sites with 100's of these pages, they would become a little silly and not much use to the searcher in the SERPs Thanks for any help!
On-Page Optimization | | kyegrace1 -
Would it be bad to change the canonical URL to the most recent page that has duplicate content, or should we just 301 redirect to the new page?
Is it bad to change the canonical URL in the tag, meaning does it lose it's stats? If we add a new page that may have duplicate content, but we want that page to be indexed over the older pages, should we just change the canonical page or redirect from the original canonical page? Thanks so much! -Amy
On-Page Optimization | | MeghanPrudencio0