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 in Google search is defferent
Hello, Google changes the title of the main page only for my sites in this way: What I configured: My page title | my site name How it shows in Google: My site name: My page title If I checked some meta tags analyzer it will show my configured page title and also in Bing.com So what do you thing about it. Best Regards, Housam
On-Page Optimization | | anubis20 -
Optimal amount of alt and title tags on a landing page?
Hey guys! We are preparing a few product landing pages and want to make sure the alt and title tags are done correctly. We looked at landing pages from Apple and Google Nexus and found that they had very few alt and title tags (or none). Are we missing something here? Should there be an alt for every image and title for every link?
On-Page Optimization | | TVape0 -
Using Canonical Tags on Every Page
I'm doing competitive research and noticed that one of our competitors (who outranks us) uses canonical tags on every page on their site. The canonical tags reference the page they are on. For example. www.competitor.com/product has a canonical tag of www.competitor.com/product. Does anyone use this practice? It seems strange to me. Thank you, Kristen
On-Page Optimization | | Ksink0 -
Should I use bolded keywords for keywords in the content throughout the page?
If I'm trying to optimize for a specific keyword, should I bold all of the keywords that appear in the content of the page or just one or two? or none at all?
On-Page Optimization | | globalrose.com0 -
Anchor text in Ecommerce site without relevant pages
I'm posting articles to my e-commerce site and just wondering about the anchor text links within the posts. I don't have relevant static pages but the items do come up in a search query. For example i don't have a specific page for red wine but if a user searched for red wine it would give a search query URL. Should I use that search URL query as my anchor text?
On-Page Optimization | | acs1110 -
I have one page on my site... but still get duplicate name and content errors.
i have only the index.html page. my domain has a permanent 301 to the root. why am i getting duplicate problems? i only have one page the index .html???
On-Page Optimization | | one4u2see0 -
What URL Should I use in Google Place Page?
Alright, I have a client that has 1 website and 14 locations. We want to create place pages for each of their locations but my question is which URL should I put in the place page and why? I can put in the root domain into each place page, or should I put in the URL that lands on the actual location on the root. example: domain.com/location1 Thanks!
On-Page Optimization | | tcseopro0 -
Getting page cached
I am reworking some content that is deep in my site. What is the best way for google to find it? Some of the pages were cached about 3 weeks ago, but I don't want to wait too long to get them to see the new content (and links).
On-Page Optimization | | azguy0