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
-
Can access my site using www
Hello, when I try to access my website using www i would like it to redirect to non www but instead it shows a sal error message.
On-Page Optimization | | Voopoo2 -
Is it safe to use Microformats and Schema.org on one page?
I'm running a news blog and I'm using schema.org/NewsArticle. I would like to know if I should add microformats on the article page too or just use the schema? If I add both, will it effect my sites SEO/ranking? Thank you
On-Page Optimization | | hakhan2010 -
Do sites built with WordPress work in China get indexed by Baidu?
I think that WordPress.com is banned, but are websites that are created by WordPress get banned?
On-Page Optimization | | CoGri0 -
Best practices for marking up product pages on eccomerce site (SEO noob)
After analyzing the code on various competitors eccomerce sites I wanted to seek advice on best practices for marking up individual product pages for keywords and descriptions. My competition is all over the map as far as utilizing keywords and descriptions, some have few keywords while others have many and vice versa for descriptions. What is the best method for marking up product pages on an eccomerce site for keywords and descriptions? In addition, is it okay to utilize the same keywords for multiple products that may be under the same category? or is this considered duplicate content? Thanks for the help, if you have any resources for SEO and eccomerce sites I would greatly appreciate the guidance best,Michelle & Blake
On-Page Optimization | | LeapOfBelief0 -
www vs no-www duplicate which should I use
site is no-www I caught this in archives. Will this by my fix? Mike Davis Online Marketing Manager at McKesson May 22, 2013 Easy fix: in your .htaccess file, use this RewriteEngine On
On-Page Optimization | | touristips
RewriteCond %{HTTP_HOST} !^domain.com
RewriteRule (.*) http://domain.com/$1 [R=301,L] Remember to replace domain.com with your domain name.
Enjoy!0 -
To use or not to use: Keywords with locations
Hello there. I work for a marketing agency that manages SEO campaigns for a variety of small businesses in South Florida. Let's say we have a client that sells cheap shoes at their store location. Obviously, we want to show up in Google rankings for search terms like "cheap shoes south florida" or "cheap shoes miami." Now, my question is, when optimizing a website's content for various keywords, is it really necessary to include keywords with the location (which are often awkward for both reading and writing purposes)? Ideally, I'd prefer to have text that always reads as naturally as possible. Text like this is just an eyesore: Welcome to ExampleSite.com, home of the best cheap shoes Florida. We offer all kinds of cheap shoes Boca Raton. Your whole family doesn't have enough fingers and toes to count how many cheap shoes West Palm Beach we have in stock! Contact us to ask about our cheap shoes Miami discounts today! Olé!" What say you? Is there a way to work around ugly SEO text like this while still effectively ranking for GEO terms? Thanks!
On-Page Optimization | | BBEXNinja0 -
What font should i use for my text to make page better
Hi i have changed a page layout and first of all would like to know what people think, also i would like to know what font i should be using to make the page better. My website is www.in2town.co.uk any help would be great
On-Page Optimization | | ClaireH-1848860 -
Title tags in duplicate pages
hi there, we have a new ecommerce platform which has just been deployed, and I've been asked to tidy up the onpage SEO. we have employed canonicals across the category and product pages and we now have a nice set of unique product pages my question is - do we need to create the title tags in all of the duplicate non-canonical pages eg www.mysite.com/niceproduct.html (canonical) www.mysite.com/acategory/niceproduct.html (duplicate) Can we leave the duplicate title tag empty and not worry about it, or should we put in a duplicate of the canonical title tag hope the question makes sense! thanks in advance for all help
On-Page Optimization | | k3nn3dy30