Putting Meta info on Content pages

Last post 10-23-2009 9:09 AM by GinoK. 10 replies.

Sort Posts:

  • Putting Meta info on Content pages

    02-15-2009, 2:00 PM
    • Member
      2 point Member
    • LisaMac
    • Member since 01-22-2009, 4:56 AM
    • Posts 19

    Hi, apologies, I ticked my earlier question on this as having been sorted - but on trying the solutions two kind people gave, it doesn't work. My goal is to have different Meta information on my Content pages - different from the MasterPage that is. My Content page contained this....

    <%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" %>

      <script runat="server">

    </script>

      <asp:Content ID="Content1" ContentPlaceHolderID="leftContent" Runat="Server"></asp:Content>

    I tried to add what the two respondents told me. The first change I made to my Content page, using the method suggested to me, looked like this....

     

    <%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" %>  <script runat="server" type = "text/VB" >

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim meta As HtmlMeta

    meta = New HtmlMeta()

    meta.Name = "keywords"meta.Content = "sas, sas, sas, sas"

    Page.Header.Controls.Add(meta)

    End Sub

    </script

     

     <asp:Content ID="Content1" ContentPlaceHolderID="leftContent" Runat="Server"></asp:Content>

     

    As you can see above, I inserted into position exactly as the answer instructed, but it didn't work. The result was, when I loaded the page the original Meta descriptions were still in place from the MasterPage, they were not replaced as I'd hoped, instead this extra line was found in the source code.....

    <meta name="keywords" content="sas, sas, sas, sas" />

     

    Did I understand the instructions given to me I wonder?

    I really am very new at this, very new - I even need to be told about full-stops, and noddy stuff please. I still can't get my contents page to have their own Meta lines, they still keep reading those from the MasterPage - would there be any other suggestions please?

    Regards,  LisaMac

     

     

     

     

     

     

  • Re: Putting Meta info on Content pages

    02-15-2009, 5:40 PM
    • Contributor
      2,369 point Contributor
    • Rick Matthys
    • Member since 01-20-2009, 3:57 PM
    • Oregon
    • Posts 336

    Hello Lisa,

    First, if you're very new at this, then let me make a couple of suggestions....

    1) Keep your code out of the .aspx files.  You (and anyone who has to look at it) will be much happier in the long run.

    2) If you add the code you show above in your page load, it will add the metadata to the header.  When the page is in the browser, do a view source, and you will see it. 

    3) I assume you're adding keywords to the metadata for search engines...  DONT BOTHER.  Add a description tag so the when the page is found, it may choose to display a snippet to your liking.  But adding KEYWORDS will not affect your ranking... maybe 10 years ago, but not today.  There's lots of good SEO information on the google webmasters forum, check it out.

    Good luck. ~Rick

    If your not seeing your metadata, do a view source and post it here... would like to see it.

    Please mark the post as ANSWER if it helps you

    Disclaimer: Just my opinion. Not my employer or anyone else....
  • Re: Putting Meta info on Content pages

    02-15-2009, 5:58 PM
    • Star
      10,558 point Star
    • Danny117
    • Member since 12-16-2008, 2:30 PM
    • Royal Oak Michigan USA
    • Posts 1,837

    Your doing great!  

    LisaMac:

    instead this extra line was found in the source code.....

    <meta name="keywords" content="sas, sas, sas, sas" />

    Keywords go in the source.  The description meta goes in the source too.

    Page.title ="LisaMac's page"  /* is a built in to page title. */

    You'll be in the search engines soon.  1-7 days.  You won't be first but you should be able to search for your pages and find them if you filter to only your domain.

     

     

     

     

     

    Good Luck



  • Re: Putting Meta info on Content pages

    02-16-2009, 12:21 AM
    • Member
      2 point Member
    • LisaMac
    • Member since 01-22-2009, 4:56 AM
    • Posts 19

    Rick Matthys:
    2) If you add the code you show above in your page load, it will add the metadata to the header.  When the page is in the browser, do a view source, and you will see it.

    Yes I saw it in the browser view source - but I was trying to 'replace' the Meta information in my header, not 'add' to it. That is, I was trying to put different Meta info in my Content page, instead of it keep reading from the MasterPage every time - and when I added the code above it never replaced, as I was trying to do. But not to worry as your number 3 might solve it.......

    Rick Matthys:
    3) I assume you're adding keywords to the metadata for search engines...  DONT BOTHER.  Add a description tag so the when the page is found, it may choose to display a snippet to your liking.  But adding KEYWORDS will not affect your ranking... maybe 10 years ago, but not today.  There's lots of good SEO information on the google webmasters forum, check it out.

    This comes very close to what I need. You see Google keeps putting up identical snippets, regardless of which page of mine is found, yet I want each page to have its own snippet. So maybe I asked the wrong question (apologies for that) and maybe your mention of a 'description tag' will do the trick for me? How do I insert one of those? (you have to be precise, you know how thick I am) and on which line/page/other do I put it on?

    Cheers  LisaMac

  • Re: Putting Meta info on Content pages

    02-16-2009, 12:24 AM
    • Member
      2 point Member
    • LisaMac
    • Member since 01-22-2009, 4:56 AM
    • Posts 19

    Danny117:
    Your doing great!  

     

    You're always nice to me. You were real friendly in my other question last week. Thanks - it makes me feel comfortable.

     

    Kind Regards,  LisaMac

  • Re: Putting Meta info on Content pages

    02-16-2009, 2:03 AM
    • Contributor
      2,369 point Contributor
    • Rick Matthys
    • Member since 01-20-2009, 3:57 PM
    • Oregon
    • Posts 336

    Hello LisaMac,

    As you know, depending on how frequently your site has been changing (among other factors), it may take a little while before your page is reindex.  When it does get reindexed, you should see some new snippets if you add the tag below:

    <meta name="Description" content="Description here....." />

    If you post your site, i'd be glad to take a peek from an SEO perspective....

    ~Rick

    Please mark the post as ANSWER if it helps you

    Disclaimer: Just my opinion. Not my employer or anyone else....
  • Re: Putting Meta info on Content pages

    02-16-2009, 5:34 AM
    • Member
      2 point Member
    • LisaMac
    • Member since 01-22-2009, 4:56 AM
    • Posts 19

    Rick Matthys:

    As you know, depending on how frequently your site has been changing (among other factors), it may take a little while before your page is reindex.  When it does get reindexed, you should see some new snippets if you add the tag below:

    <meta name="Description" content="Description here....." />

    Thanks for responding. Your last sentence, about seeing the new snippets by adding the tag, brings me back full circle, to the very reason why I started asking my question, and which I still can't resolve.......? You see, I need to add different tags to my Content pages, different from those in my MasterPage. If I just add what you  suggested that would not replace the ones my pages read from the Master. And if I add what was suggested to me earlier, that also did not replace the info being read from the Master - and that is what my problem is?

    All of my tags (I've been calling it Meta info, but I mean the same as what you're talking about), well all of these are identical across my site, whichever page Google spiders it still reads the same Meta stuff, the same tags or whatever this stuff is called - and I need each page to show different snippets on Google. I've checked the source view of every page in my browser, it all reads identical. I'm struggling....? 

     What about if I did this...... just omit any of those Meta lines (or tags or whatever their name is - there's rows of them) from my MasterPage. Just don't put any of it in there?  Then, everytime I add a new page just plonk it all in there?  Different for each page of course.   (which is what I'm after, so that I have different Google snippets). I could do that, yes?

     

    LisaMac

  • Re: Putting Meta info on Content pages

    02-16-2009, 6:36 AM
    • Star
      10,558 point Star
    • Danny117
    • Member since 12-16-2008, 2:30 PM
    • Royal Oak Michigan USA
    • Posts 1,837

    Your welcome I'm on a ramdom acts of worldwide kindness kick these days.  The search engine sees what goes to the browser (view source).  I have a generic description on my master page in case I forget to put a description in somewhere.

     

    Good Luck



  • Re: Putting Meta info on Content pages

    02-16-2009, 11:15 AM
    Answer
    • Contributor
      2,369 point Contributor
    • Rick Matthys
    • Member since 01-20-2009, 3:57 PM
    • Oregon
    • Posts 336

    Good morning,

    You probably don't want to add a description metatag to your masterpage. The description for each page should be unique so it makes sense just to include them in content pages.  But, if you have metatags in your master and want to update their info, then do the following:

    In the master page, add a content holder for your metatags:

    <asp:ContentPlaceHolder id="metatags" runat="server">
          <meta name="description" content="Show this snippet if no description tag in content page" />
    </asp:ContentPlaceHolder>

    In the content pages, overwrite the master page metatags by adding:

    <asp:Content ID="Content1" ContentPlaceHolderID="metatags" Runat="Server">
        <meta name="description" content="Overwrite description in master" />
    </asp:Content>
    

     This will replace the metatags in the master page instead of just adding more. 

    Hope this helps... ~Rick

    Please mark the post as ANSWER if it helps you

    Disclaimer: Just my opinion. Not my employer or anyone else....
  • Re: Putting Meta info on Content pages

    02-16-2009, 1:40 PM
    • Member
      2 point Member
    • LisaMac
    • Member since 01-22-2009, 4:56 AM
    • Posts 19

    Rick Matthys:
    You probably don't want to add a description metatag to your masterpage. The description for each page should be unique so it makes sense just to include them in content pages. 

    There you go. That's the answer. You see I knew the description tags had to be unique, that's what I've been trying to say all along, and trying to learn how to do that - but what I didn't know (and after all this, your one little line clarifies it all for me) what I didn't know was that I did NOT have to put a description metatag on my masterpage in the first instance.  All this time I thought it was important for it to be there on the masterpage, prior to producing all my Content pages (hence struggling to make my Content pages have different description tags).

     

    For me the answer is not to put them on my Masterpage in the first place. But for any future readers coming across this page, if you still want to put a description tag on your Masterpage - and have different description tags on your content pages - then the answer that Rick gave immediately above, works. I tried it. I inserted the  asp ContentPlaceHolder -  all as he described in his answer -  and it works.

     

    Many many thanks. You guys that respond to these queries are so helpful.

    Kind Regards,

    LisaMac

  • Re: Putting Meta info on Content pages

    10-23-2009, 9:09 AM
    • Member
      2 point Member
    • GinoK
    • Member since 10-23-2009, 9:03 AM
    • Posts 1

    Ricky,

    that's really useful. I have been looking for solution to this for a while. Just one note of caution  for anyone using vs2005. When following this procedure the IDE will give a validation error on the contentplaceholder tag in the header. I thought I had typed something wrong and tried to fix error. However, the error can just be ignored and it works as Ricky explained.

    thanks again.

     Smile

Page 1 of 1 (11 items)