Welcome to WebmasterWorld Guest from 34.204.36.101

Forum Moderators: ocean10000

Message Too Old, No Replies

Dynamic META description tag

ASP template site

     
2:31 pm on Jul 11, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 18, 2003
posts:745
votes: 0


I have a site largely based on one ASP template. This means that the Meta description tag is the same across much of my site. I would like to dynamically change my Meta description based on part of each page’s title.

For example a current page may be:

<title>Big Furry Red widget – item # B745</title>
<meta name="description" content="Bob’s Shop – Buy the best stuff at our site.">

Currently the ‘Bob’s Shop” description appears on all item pages. I would like to make each pages description unique by dynamically displaying a piece of the pages title tag as below:

<title>Big Furry Red widget – item # B745</title>
<meta name="description" content="Big Furry red Widget">

Apparently having the same Meta Description across a web site will hurt complete SE spidering, so it would be great if I could have unique descriptions across my site.

Is what I am trying to do possible? If so, can someone point me in the right direction on how to do it with ASP?

2:52 pm on July 11, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 29, 2002
posts:981
votes: 1


Yes it is possible, but it's difficult to explain how to do it without further details about how your site works.

ASP pages work by putting lumps of dynamic ASP code into the HTML delimited by <% ... %>, so, for example, your page template may look like:

<title><% =strProductName %> - item # <% = strProductCode %></title>
<meta name="description" content="Bob’s Shop – Buy the best stuff at our site.">

So to change the meta descrip to a dynamic one you would modify the template to something like:

<title><% =strProductName %> - item # <% = strProductCode %></title>
<meta name="description" content="<% =strProductName %>">

NB: strProductName and strProductCode are made up variable names; your system will use something different. HTH.