Forum Moderators: open

Message Too Old, No Replies

Dynamic META description tag

ASP template site

         

jdancing

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

WebmasterWorld Senior Member 10+ Year Member



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?

mattur

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

WebmasterWorld Senior Member 10+ Year Member



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.