Hi,
We are planning on having our meta description tag on product pages be filled in dynamically with our short product description. If our product description includes characters such as quote marks and the like will it mess up the way the tag is read? In other words since the meta field itself is defined by quotes would throwing a quote in the middle (like an inch mark) throw off how the field is read?
Example: <meta name="description" content="Grill Cloth Black Yard 70" Wide. Open weave grill cloth is virtually 100% acoustically transparent.">
Thanks,
gsimerlink
Are you a Google Analytics enthusiast?
Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE!

www.CustomReportSharing.com
From the folks who brought you High Rankings!
More SEO Content
International SEM | Social Media | Search Friendly Design | SEO | Paid Search / PPC | Seminars | Forum Threads | Q&A | Copywriting | Keyword Research | Web Analytics / Conversions | Blogging | Dynamic Sites | Linking | SEO Services | Site Architecture | Search Engine Spam | Wrap-ups | Business Issues | HRA Questions | Online Courses
Dynamically Created Meta Description
Started by
gsimerlink
, Apr 23 2009 10:26 AM
7 replies to this topic
#1
Posted 23 April 2009 - 10:26 AM
#2
Posted 23 April 2009 - 10:40 AM
could do, but you could get around this by removing them from the text on the fly.
For instance, if you're using PHP, you could process the variable containing the text as follows...
I'm sure there would be a similar function in ASP or whatever you might be using.
Hope that helps
For instance, if you're using PHP, you could process the variable containing the text as follows...
CODE
$descritpionTag = str_replace("\"", "", $rawDescription);
I'm sure there would be a similar function in ASP or whatever you might be using.
Hope that helps
#3
Posted 23 April 2009 - 11:13 AM
If the data is being pulled from a DB, you could store the data HTML encoded, or process it as rolf says prior to adding to the rendered HTML doc.
what language are you using and where's the data coming from?
what language are you using and where's the data coming from?
#4
Posted 23 April 2009 - 12:58 PM
If the data is being pulled from a DB, you could store the data HTML encoded, or process it as rolf says prior to adding to the rendered HTML doc.
what language are you using and where's the data coming from?
what language are you using and where's the data coming from?
We are using Coldfusion and pull our data from an in house CMS that uses SQL
#5
Posted 23 April 2009 - 01:39 PM
It's been awhile since I've used CF, but this might help to get ya started. It assumes variable is named mdOutput, so change that as needed to match.
Note, that second parameter in the replace() function is a ' " ' (or single quote, double quote, single quote) without any spaces.
CODE
<CFSET mdOutput = replace(mdOutput,'"','','all')>
Note, that second parameter in the replace() function is a ' " ' (or single quote, double quote, single quote) without any spaces.
#6
Posted 23 April 2009 - 02:20 PM
On the same topic is html encoding of the data bad or is it best to strip it all out and go plain text?
#7
Posted 23 April 2009 - 07:56 PM
It depends.
If you're only using string data where no html should be present, it's best to strip it out before it's saved to the database. If you need the html, say because the info was going to be displayed later in a table that changes a bit, then you'd be better off saving it as html encoded. I don't remember what it is off the top of my head but I believe CF has a built in function to encode or at least escape html elements.
If you're only using string data where no html should be present, it's best to strip it out before it's saved to the database. If you need the html, say because the info was going to be displayed later in a table that changes a bit, then you'd be better off saving it as html encoded. I don't remember what it is off the top of my head but I believe CF has a built in function to encode or at least escape html elements.
#8
Posted 24 April 2009 - 03:33 AM
Well for the example, the quote was being used as the unit of measurement, stripping it out wouldn't work in that case as they want the quote to indicate inches.
Therefore you would need to escape it rather than remove it.
Therefore you would need to escape it rather than remove it.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users









