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
-
How many hyphens are allowed in page titles or image names?
When I was going through certification, I was told it should be limited to one or two. I was curious if there is a change.
On-Page Optimization | | SeobyKP0 -
Use of '&' in meta title
Hi, I know that use of '&' would be helpful to save space and also add more keyword variation to the title tag. But just want to make sure if it matters if I use '&' in most of my title tags? And also is it common to use more than & in one title? Would the following title be different in Google's perspective regardless of the title length? I am thinking they are all targeting the keywords 'fruit cake' and 'fruit bread', but the first one is the best. buy fruit cake & bread buy fruit cake & fruit bread buy fruit cake and fruit bread Thanks in advance.
On-Page Optimization | | russellbrown0 -
The seomoz on page keyword analysis tool is not showing title or keyword in document
the SEOMOZ onpage analysis tool is not not showing title or keyword for any page in one of my sites. It says there are no title elements on my page and there are, i checked the source code myself and they are there and correct. my title and keywords are in there and show up fine in firefox and internet explorer even after i refresh them. why would this tool show them as missing in one of my sites but not others? I'm worried that google's spider might not see them if the on page analyzer doesn't see them and my rankings might drop. they showed up the other day in the seomoz on page analyzer just fine and i haven't changed anything. Thanks mozzers!
On-Page Optimization | | Ron100 -
On-Page Report Card: Whats up with the TITLE of the page?
Started to fix the SEO issues on a customers website. When I run a "On-Page Report Card" It says that the title of the webpage:
On-Page Optimization | | maklarlabbet
www.visbymaklarna.se/visbymaklarna.html Is "visbymäklarna - Ditt förstahandsval på gotland." But if I check in the source code of the webbrowser the title should be:
name="title" content="Vi är mäklarna på Gotland som sätter människan i första rummet" /> (Actually this is with special encoding for the swedish characters. The title in coded text is: "Vi är mäklarna på Gotland som sätter människan i första rummet") Anyway the title of the webpage source code and the title of what SEOmoz reports is different. Why is that?0 -
How to fix duplicate page content and page titles?
Apologies in advance if this has already been answered (it probably has) - I'm just not seeing it. Is there a guide on here for how to fix the issues brought up by the crawler - specifically, things like duplicate page content, or duplicate page titles? A lot of these seem to have been created by wordpress.org combos that I didn't anticipate - i.e., category pages, author pages, etc. The crawler brings up the problems, but I don' t know where to start to go about fixing them. Also, any guide on best SEO practices or fixing optimization problems, specifically for wordpress.org blogs, would be greatly appreciated. Thanks!
On-Page Optimization | | prospects1 -
The Better Title to Use?
Hello Mozers- I am targeting the keywords "liposuction scottsdale", "liposuction phoenix", "liposuction mesa", "liposuction arizona". Out of the following two Titles below, one would you consider the better one? And Why? I am leaning towards the second example. If you have any more ideas that would be great. 1). Tummy Tuck Scottsdale, Phoenix, Mesa, Arizona 2).Tummy Tuck Scottsdale | Tummy Tuck Phoenix, Mesa, Arizona. Thanks!!
On-Page Optimization | | Red_Spot_Interactive0 -
Best Way to check for duplicate pages
With Google's updates we know they want to clean out duplicate content. i have been seeing the same crap spit out even word for word on different sites. Anyway how do you experienced SEO people test for dups on your own site as well as other sites. The only thing i can come up with is paying copyscape 5 cts a test. There has to be other ways. Advise/
On-Page Optimization | | joemas990 -
Hiding Page Titles By Display None
Hi. I am new to this community, and new to SEO as well. A friend asked me to give them suggestions on onsite optimization for their Drupal website. I know page titles are very important, and usually they should be set to H1. (At least I think) This particular website has all their page titles set to H2 and they are using display:none in their stylesheet to hide them for graphic design reasons. What would be the most practical work around for this? We don't want this to appear sketchy in the eyes of the SE's, but putting page titles at the top of their pages really would take away from their graphical design. The second issue is that they use a module called Quicktabs for tabbed product specs on each page. Each tab is actually pulled from a post (called a node in Drupal), so each tab has it's own title that is an H2. So not only are they hiding the main page title, but they are hiding 5 others within the tabs, and their are 6 H2 elements showing up on each product page all set to display:none. Any creative suggestions? Hope that makes sense.... Thank you!
On-Page Optimization | | aprilm-1890400