No, Meta Description tags are not dead. Keywords, sure. But not descriptions. They’re great for making sure your pages are accurately represented in search results, and they tell the search engines a bit more about your page. This is important to me because as I finish touching up a new public-facing website in SharePoint 2010, I’m on a mission to make sure our SEO and rankings don’t take a dip as a result of the switch. Getting your hands into SharePoint to tweak things like meta tags, etc. can be tricky. But here is a (seemingly) simple solution.
For info on what Google says about best practices for meta description tags, click here.
So here goes:
- Create a new site column (my preferred method) called Meta Description
- Add this new site column to your custom content type (still keeping things clean)
- Add the following code to the HEAD section of your Master Page:
<asp:ContentPlaceHolder id="myMetaDescription" runat="server" />
- Add the following code to your custom page layout (I put mine at the bottom). Note that the SharePointWebControls (commented out here) piece is the custom column that we created earlier. So your FieldName will naturally be different than mine. Uncomment and replace with your field.
<asp:Content ContentPlaceholderID="myMetaDescription" runat="server"> <asp:literal ID="meta1" runat="server" Text="<meta name="description" content=""/> <!-- <SharePointWebControls:NoteField FieldName="0383b91e-83c4-4bc3-9ce3-d40e7a8acebb" runat="server"></SharePointWebControls:NoteField> --> <asp:literal id="meta2" runat="server" Text="">" /> </asp:Content>
- Now, when you click Edit Properties on your page, you’ll see a field called Meta Description, which is where you’ll type a short snippet that search engines will love!
To double check everything, create a new page, edit its Meta Description field, and then view source in your browser to make sure your description is coming through. Caveat: if you don’t put anything in the meta description field, this won’t play well. Looking for a fix to only show the meta tag if there is a description. Will update if I find it.
And of course, if you have a better way of doing this, or any suggestions, let me know!
Credit: most of this solution was created from code on this forum.
#update [05/25]: I just stumbled across this solution here as well. I’m not sure which came first…but thanks to whoever it was!