Easy editing meta tags for Publishing Pages with Mavention Meta Fields

, , , ,

Including meta tags for pages on Internet-facing websites is very important. Additional information included in meta tags makes it easier for search engines to find and classify the content. Still many websites either don’t use meta tags at all or don’t provide content editors with a simple mechanism for managing the meta tags making managing the meta tags a one-time process. In many situations meta tags are not even a part of the information architecture for Internet-facing websites and are easily being forgotten in the development process. Additionally, as they are not being displayed on the screen, they are not a part of the branding what makes it challenging for the developers to provide an intuitive editing interface for. Mavention Meta Fields is a turn-key solution that allows you to easily add support for managing page-level meta tags even if your website is almost ready to go on-line.

What is Mavention Meta Fields?

Mavention Meta Fields is a SharePoint solution that allows you to easily add meta tags to Publishing Pages. If you haven’t included meta tags initially as a part of your information architecture or you’re looking for an easy way to add meta tags to Publishing Pages, Mavention Meta Fields is the right solution for you.

Configuring Mavention Meta Fields

Upon deployment Mavention Meta Fields install a Site Collection Feature called Mavention Meta Fields. All you have to do to use Mavention Meta Fields is to activate this single Feature. That’s it. You don’t have to do any changes to your Master Pages or Page Layouts to use Mavention Meta Fields.

The Mavention Meta Fields Site Collection Feature available after deploying the Mavention Meta Fields Solution

In order to use Mavention Meta Fields with your existing Publishing Pages you have to add new columns to your existing Content Types. Those columns will store the contents of meta tags for Publishing Pages. There are two things that you have to consider while adding those columns. First of all the display name of the field determines the name of the meta tag that will be included in your page. Secondly, in order for the field to be picked up by Mavention Meta Fields as a meta tag field, it has to be added to the Publishing Meta Tags group. In my example I’ve added two Site Columns called description and keywords.

description and keywords Site Columns in the Publishing Meta Tags group

Once the columns are in place you have to add them to the Content Types. In this example I’ve added them to the out of the box available Welcome Page Content Type.

description and keywords Site Columns added to the Welcome Page Content Type

And that’s all. You can start using Mavention Meta Fields now.

Editing meta tags with Mavention Meta Fields

When you navigate to a Publishing Page you won’t see much difference. But as soon as you edit the page, the meta tags editor will appear on the right side of the page right under the Status Bar:

Meta tags editor under the SharePoint Status Bar

After you click the show page metadata link, the edit panel will slide down and you will be able to edit the values for your meta tags:

Editing meta tags values using the Mavention Meta Fields solution

Once you’re done, save the changes. The meta tags editor will disappear again, but if you view the HTML source of the page you will notice two meta tags added with the values that you have just added using the meta tags editor:

description and keywords meta tags added by the Mavention Meta Fields control

Summary

Mavention Meta Fields is a great solution for managing meta tags for Publishing Pages. Because it doesn’t require you to do any changes to your Master Pages and Page Layouts it’s a great solution for adding meta data to your Publishing Pages even if you haven’t taken it into account while designing the website and its intuitive interface makes it really easy for the content editors to manage the meta tags. Depending on your requirements you might need to include some additional information in the meta tags. Using the Mavention Meta Fields solution you can easily add additional fields by including them in the Publishing Meta Tags groups.

Download: Mavention Meta Fields (31,8KB, WSP)

70 Responses to “Easy editing meta tags for Publishing Pages with Mavention Meta Fields”

  1. Susanne Says:

    Hi there!
    I have installed your feature on a Publishing Site and it works just fine with the OOB masterpages!

    However, I would like to make it work with my branded masterpage, based on Randy Drisgills _starter.master (http://startermasterpages.codeplex.com/). Is there something that I have to modify? Are there some special html-tags or contentplaceholders that are dependent on your solution?

    Please, please advise me further!
    Thanks!

  2. Waldek Mastykarz Says:

    @Susanne: the only dependency that I can think off is the AdditionalPageHead Delegate Control but as far as I know it's in Randy's Master Page. Any specific errors that you're getting or you're not seeing the control at all?

  3. Susanne Says:

    No specific errors, just not seeing the control.
    I have looked at the generated source code, but there is nothing there either, so it's like it isn't generated at all.

  4. Susanne Says:

    I tried with a non-modified starter.master from Randy, but the same problem arises. It just doesn't show up when in edit mode.

  5. Waldek Mastykarz Says:

    @Susanne: but everything works correctly when using one of the out of the box Master Pages?

  6. Susanne Says:

    Yepp!

  7. Susanne Says:

    Hey, I found the problem!!
    It seems that Randy's masterpage(and mine also) are missing the .body-wrapper class. I saw that now when I studied the generated script through IE Developer toolbar.
    When I applied the class on one of my div's…Voilá!! It is shown and works like a charm!

  8. MOSSBuddy Says:

    Waldek great stuff, I wanted to understand if this metadata (additional one) will be added as part of the page columns also, correct? Meaning will be added to the PAGES library as well (in the page list columns)?
    Also what if there are 5 different content types used in the Page Layouts, and all the 5 need different set of metatags (i.e. one content type needs MetaTag1 and second needs MetaTag2)? Will adding these 2 site columns to the Specific group in site columns and then appropriately adding them to the content type take care of adding the columns and showing only them on specific Pages using that content type?

  9. Waldek Mastykarz Says:

    @MOSSBuddy: At this moment it would unfortunately pick up all fields, but you're right: it should only pick up fields associated with the specific Content Type. I will be releasing a new version soon which will have this issue fixed. Thanks for the great feedback!

  10. Nishan Bala Says:

    For some reason the edit meta panel failed to show up on our site which uses a custom master page. We did start with Randy's Master page and inserting the .body-wrapper class didn't help.

    Here is an alternative yet simple solution for those interested. Insert the below in the header section of your master page:

    source: http://bit.ly/99pxnf

  11. MOSSBuddy Says:

    Thank you Waldek, you are awesome. You are a great community guy and lots of folks should learn from you hw to spread the knowledge…thanks again.

  12. Ronak Says:

    Thanks Waldek for such nice SEO thing.I have couple of Question first one there is already keywords Column under Core Document Columns so i can pick anyother name second i have some custom content type as u know all of them should inherit from Page content type so instead of adding this two columns in all content type can i add only in page content type and then all other content type will inherit them.
    Please advise

  13. Waldek Mastykarz Says:

    @Ronak: Using a different column for the Keywords is not a problem with Mavention Meta Fields. By default Mavention Meta Fields uses the Field's *display* name to render the meta tag so you can create your own Field with a unique Internal Name and then give it the Keywords display name so that it will result in the desired meta tag.
    As for the second question, I haven't checked it myself, but wouldn't the Fields defined in the parent Content Type appear as a part of your Content Type, meaning you should be able to use them without any extra work?

  14. Ronak Says:

    Thanks for Reply yes can i use fields from parent content type in page Layouts so i think adding them in Page content type will work let me try and will give you feedback…

  15. Soren Says:

    This is a great feature that we indeed can benefit from. We are experiencing one issue though. We are not able to create site columns with name 'description' and 'keywords' because they already exists. We have created columns with different names but are not able to change the display name. Neither via SharePoint Designer nor via Site Settings.

    Do we miss something?

  16. Waldek Mastykarz Says:

    @Soren: As I mentioned in the article you cannot create another Description field since there is already one available out of the box. You should however be able to rename the field after creating it. Are you getting any errors?

  17. Soren Says:

    @Waldek: No, we are not getting any errors. And we can change the site column display names manually for each folder.

    Let me go a little bit more into details with our case:

    We have an internet facing site with numerous subsites. More subsites are being added over time. We would like SEO meta tags on all our pages in every Pages folder in every site. Existing as well as coming ones.

    Up until now we have configured everything as specified in the article. We have created two columns with our own name specified, placed them in the Publishing Meta Tags group and added them to our content type. We can see the meta tags fields when editing a page. We can also manually change the site column display names to whatever we want (so far so good) but this is not an acceptable solution. This should preferably be done automatically.

    Should we script our way through this? And run the script automatically every day from now on? Or is there another way we can skip the manual part changing site column display names?

  18. Waldek Mastykarz Says:

    @Soren: You should be able to create custom fields using a Feature as well. The trick is to use a unique InternalName and the Description/Keywords DisplayName. By putting those fields in the Publishing Meta Tags group and adding them to your Content Types you should be able to get this done automatically.

  19. Felipe Says:

    Hello, Waldek.

    I could not put the feature to run.
    I followed the steps bellow:

    - Installed the WSP package
    - Activated the feature on the site collection
    - Created two new site columns
    - Put these new columns on the group "Publishing Meta Tags"
    - Added the site columns from the group Publishing Meta Tags on the content types of the site pages.

    When editing the pages, I cannot see the link "show page metadata".

    I'm using a brand new site collection, without any customizations, created just for this test.

    Do you know what can be wrong?

    Thanks.

  20. Waldek Mastykarz Says:

    @Felipe: are you using standard or a custom Master Page?

  21. Felipe Says:

    @Waldek: I'm using the standard Master Page.
    My SharePoint version is:
    Microsoft SharePoint Server 2010 version 14.0.4763.1000
    (Portuguese – Brazil)

  22. Thiago Says:

    deployed the solution and created the columns…unfortunately, I have to go to every Pages library in every site in my site collection, to rename the displayname for the site column (which I had to name as metadescription and metakeywords).

    I have 2 columns which I use to populate text and hyperlink on a visual element of the home page (this is a public site), but when I add the meta columns to the pages library, the content for those columns doesn't get rendered on the page. Any ideas? Maybe a js or css conflict??

  23. Waldek Mastykarz Says:

    @Thiago: Did you add the field to the Publishing Meta Tags group as mentioned in the article? If so, could you confirm that you don't have any JavaScript errors?

  24. Soren Says:

    @Thiago: Next time create your site columns with a Powershell script then your are able to name them correctly from the start (description and keywords).

  25. Thiago Says:

    @Waldek I did add the site columns to the group as described, and I get the edit boxes for the columns when editing the page, and after saving, I see the rendered meta tags when viewing the html source.

    However, my 2 other columns which render styled text on the page no longer render. I went back into the Pages library and manually deleted the 2 meta columns, and refreshed my page and that brings back rendering of my 2 columns. It's bizarre. I'll dig through JS and CSS to see if there are errors or conflicts going on.

  26. Nate Says:

    How do I change the DisplayName of the site column? I get the following error when I try to rename it to "description"
    "The column name that you entered is already in use or reserved. Choose another name."

    Side note: Why did you not implement some sort of prefix that you filter out when you render the meta tag. Something like "MV-description". Check for "MV-" and remove it when you render the meta tag. Then we could all avoid this issue. After all, the most important meta tag for us to add is the description, which always already exists out of the box. Just my two cents.

  27. Waldek Mastykarz Says:

    @Nate: In my scenario I provisioned the fields using a Feature but you have definitely a valid point, especially if you want to make this easier to content authors. Thank you for the feedback.

  28. Nate Says:

    @Waldek You can still use the Feature, just make it so we can create a column name that exists already by allowing us to prepend it with a token that we know will not be output into the markup.
    I have installed the feature, activated it, added the new site column and added that column to my page content type. I had to add the css class of "body-wrapper" to my custom master template and change my stylesheet to override the styles associated with it in order to get your form to display. Since we can't change the javascript in your solution, I recommend you change how the editpanel is added to the DOM. It is much less likely that a developer creating a custom template would remove pageStatusBar element than they would be to remove the .body-wrapper class. I believe that it would be a good solution if you were to change your javascript to prepend the panel like so:
    $("#pageStatusBar").parent().css("padding-top", "0").prepend($("#mv-metaeditpanel"));

    Both suggestions I have made would make things easier for content authors as well as save steps for developers (sharepoint wastes enough of my time).

    I still don't know how to successfully change the DisplayName of the column. Do I have to use Power Shell? If so, I am pretty new to using Power Shell and I don't know the commands. Could someone help me?

  29. Thiago Silva Says:

    @Waldek do you think that it might be a problem if my master page already registers a jQuery script (v1.4.3) at the top of the page, and then you try to add another script reference to an earlier version of jQuery??

    How about changing MetaFieldsEditor.OnInit(), so that you leverage the ScriptLink control (see http://cglessner.blogspot.com/2010/08/sharepoint-scripts-on-demand-spsod.html)? That will make sure the jQuery script is only downloaded and registered on the page if it hasn't been already. Thoughts?

  30. Thiago Silva Says:

    sorry, the text editor messed up the hyperlink to the URL above. Here it is again:
    http://cglessner.blogspot.com/2010/08/sharepoint-scripts-on-demand-spsod.html

  31. Waldek Mastykarz Says:

    @Thiago: That could be a problem indeed. Probably the easiest fix is to remove the jQuery version whatsoever so that you can use your own version of it. Using ScriptLink is definitely a nice solution as well. Thank you for the feedback.

  32. Soren Says:

    @Waldek: We too are referring to JQuery version 1.4.3 on our master page. How do we remove your version of JQuery? And what version are you using?

  33. Thiago Silva Says:

    @Soren: he's using jQuery 1.4.2. You can run his DLL through Refactor, and see that at the bottom of his MetaFieldsEditor.OnInit() event.

    @Waldek: I am not sure what your recommended solution was. I know that I have to remove one of the two referenced jquery scripts, but were you suggesting that you would update the code base for you control, to allow the user to configure it appropriately, or did you have something in mind for me to do in order to remove that referenced script?

  34. Jag Says:

    Can you run this solution on SharePoint 2007?

  35. Waldek Mastykarz Says:

    @Thiago: If you're looking for a quick fix you could overwrite the jquery file that I'm provisioning with your own version. In the future I will provide a fix where the jquery file won't have version in its name so that you can use any version. Ideally you would want to have it all configurable, but it's just a matter of time and planning.

  36. Waldek Mastykarz Says:

    @Jag: I'm not sure it will work on SharePoint 2007, since it's been created for SharePoint 2010 and I haven't tested it with SharePoint 2007. I guess there is only one way to find out and to give it a try on a SharePoint 2007 environment.

  37. Soren Says:

    @Waldek, @Thiago: How do I get the DLL? Under 'Download' I get the wsp file only.

  38. Waldek Mastykarz Says:

    @Soren: it's inside the WSP. You can either open it directly with an archive app such as 7-zip or you can change the extension to .cab and then open it in Windows.

  39. Thiago Says:

    @soren the wsp file is an archive, so you can rename it with a zip extension, then unzip it and you will find all dependencies for that solution, including the dll for the custom control.

  40. jriesen Says:

    Having the issue with the "show page metadata" not displaying on a custom master page. I have read through the comments on the site and there is mention of adding the .body-wrapper class to the custom master page. So I am assuming this should be added to the head section, but what is not obvious to me is what should that class contain for style properties? Should it just be an empty class?

  41. Waldek Mastykarz Says:

    @jriesen: You are right: the body-wrapper class is required to display the edit panel. You can see how it's being used and where it's being placed in the nightandday.master Master Page provided with SharePoint Server 2010.

  42. jriesen Says:

    I reviewed that master page before sending my first message and there is no .body-wrapper class reference on that page, at least not in the source code. Maybe it renders after JIT. Is that the case? I am thinking that the instructions for implementing this solution should be very explicit rather than having to hunt for solution to get it working. Luckily, I am not new to SharePoint, but newbies would be absolutely lost.

  43. jriesen Says:

    I retract my previous observation that the body-wrapper class is not reference in the nightandday master page. I found it. :-)

  44. renegrin Says:

    I could not get the feature to run.
    I followed the steps bellow:
    - Installed the WSP package – verified its deployed

    I can not activate the feature on the site collection; it isn't visible to activate.

    Do you know what can be wrong?
    Thanks.

  45. Thiago Silva Says:

    @Waldek – it might be beneficial for you to share the feature files you used to provision the site columns. I think ultimately, this should be a part of the solution as long as you make the internal field names pretty unique.

    I took a stab at creating the with Powershell, but a feature provisioning is much better for re-deployment purposes.

  46. jriesen Says:

    Finally got the solution working. Required that the site columns must be named "description" and "keywords" and I used PowerShell to provision the columns because they cannot be added through the site settings UI (you will get an error – these column names are reserved). Since we are using custom master page it was also key to add the .body-wrapper class reference on that page.

  47. Thiago Silva Says:

    Ok…here's my stab at the Powershell script to provision the required fields for this solution to work…

    #Get site and web object
    $site = Get-SPSite -Identity "http://www.truthaboutsurfacemining.com"
    $web = $site.RootWeb

    #Assign fieldXML variable with XML string for site column
    $fieldXML = '<Field Type="Note"
    Name="MaventionMetaDescription"
    Description="Used by Mavention Metafields solution to insert HTML Meta description in publishing pages."
    DisplayName="description"
    StaticName="MaventionMetaDescription"
    Group="Publishing Meta Tags"
    Hidden="FALSE"
    Required="FALSE"
    Sealed="FALSE"
    UnlimitedLengthInDocumentLibrary="TRUE"
    ShowInDisplayForm="TRUE"
    ShowInEditForm="TRUE"
    ShowInListSettings="TRUE"
    ShowInNewForm="TRUE"> </field>'

    #Output XML to console
    write-host $fieldXML

    #Create site column from XML string
    $web.Fields.AddFieldAsXml($fieldXML)

    #Assign fieldXML variable with XML string for site column
    $fieldXML = '<Field Type="Note"
    Name="MaventionMetaKeywords"
    Description="Used by Mavention Metafields solution to insert HTML Meta keywords in publishing pages."
    DisplayName="keywords"
    StaticName="MaventionMetaKeywords"
    Group="Publishing Meta Tags"
    Hidden="FALSE"
    Required="FALSE"
    Sealed="FALSE"
    UnlimitedLengthInDocumentLibrary="TRUE"
    ShowInDisplayForm="TRUE"
    ShowInEditForm="TRUE"
    ShowInListSettings="TRUE"
    ShowInNewForm="TRUE" > </field>'

    #Output XML to console
    write-host $fieldXML

    #Create site column from XML string
    $web.Fields.AddFieldAsXml($fieldXML)

    #Dispose of Web and Site objects
    $web.Dispose()
    $site.Dispose()

  48. Waldek Mastykarz Says:

    @Thiago: Thanks for sharing your PowerShell script. In my example I haven't used a Feature but created the columns using UI and then changed the display name using PowerShell, like:

    $w = Get-SPWeb http://win2008
    $f = $w.Fields["mvdescription"]
    $f.Title = "description"
    $f.Update()

    I've also tried using a Feature with two Field SPI's, one for each field, and it worked perfectly. All you need to do is to provide a unique InternalName while creating the Column and after importing it to your package (CKS:DEV makes this really easy), just change the DisplayName and voilla.

  49. ralf Says:

    @Waldek I have install the solution. I can the solution at the "Solution Management" site in "Zentral Administration". I also see the solution is deployed to the website that I choose.

    I also have deployed the solution to the websitte without error with PowerShell.

    But I can not see the solution in the "Website Feature" list??

    What have I do wrong??

  50. Waldek Mastykarz Says:

    @ralf: you should look for the Feature in Site Collection Feature not Site Features.

  51. ralf Says:

    @Waldek: Ok, I'm on the website "MyWebsite" on which the solution is deployed from the "Zentral Administration"

    On the website "MyWebsite" I go over "site action/site settimgs/" to the site settings site. Under "Site Setings" I use the link "Manage Site Feature" and a list of installed solutions will be displayed.

    But not your solution ??

    Is that the right place? If is, do you have any idea how i can solve this problem?

  52. Waldek Mastykarz Says:

    @ralf: No, you should go to Site Collection Features. The link is located on the Site Settings page as well.

  53. ralf Says:

    @Waldek: Please, wehere can I find the site collection feature? In Zentral Administration?

  54. Waldek Mastykarz Says:

    @ralf: On your site (not in Central Administration!) go to Site Actions > Site Settings and in the Site Collection Administration section click on the Site Collection Features link.

  55. ralf Says:

    @Waldeck: Many thanks! I have find it now.

  56. ralf Says:

    @Waldek: Now it's running. I only miss the Meta Tag editor? I use the nightandday.master.

  57. Waldek Mastykarz Says:

    @ralf: Have you added the Field to the Content Type as explained in the article?

  58. ralf Says:

    @Waldek: Yes. In the source view I see now the meta tags "description" and "keywords".

  59. ralf Says:

    @Waldek: Yes. In the source view I see now the meta tags \"description\" and \"keywords\".

  60. ZNM Says:

    hi Waldek, I m just wondering whether this can use in custom content type and layout page?
    Plz advise.. Thanks. :)

  61. Waldek Mastykarz Says:

    Yes you can.

  62. Donovan Jacoby Says:

    Hi Everyone

    Beginner question: Are licenses required for this product? I cannot find any info relating to licenses.

    Thanks

  63. Waldek Mastykarz Says:

    The version available on this blog is free of charge but it has some limitations as to what kind of Field Types are supported. Mavention offers an extended version of this solution which is a paid solution. Let me know if you would like to receive the licence information.

  64. Won Says:

    Hi Waldek,
    In the title of your post it states "for Publishing Pages", but is there any way for this to work on say, Article Page content type pages created using a non-publishing web template? We have an externally facing site using the old SPS web template, so I'm guessing that the tool won't work b/c it can't use publishing pages. Any suggestions? Thanks in advance, Won

  65. Waldek Mastykarz Says:

    It should work no matter the Web Template used to create the Site (Collection) as long as you have the publishing capabilities activated in that site.

  66. Won Says:

    Thanks Waldek! I got it to work, but ran into one add'l issue: the site collection also has In Place Records Management enabled, and this places a line above the meta tag line, causing the body to be recognized earlier so the meta tag lines end up in the body. I figure most publishing sites don't use records mgmt, but was wondering if you have any ideas on how to resolve this. Thanks again, Won

  67. Waldek Mastykarz Says:

    What is the line that is being added exactly (mind the HTML escaping when posting comments)?

  68. Won Says:

    It's , followed by an add'l set of empty span tags. I used the SP developer dashboard w/ asp.net trace to trace the id back to the In Place Records Management feature. I think part of the problem may also be due to the fact that the body-wrapper class was removed from the master page at some point in the past, but most of the contents of the class still exist, so the Mavention meta tag feature still works (it's just inserting the tag lines in the body instead). Thanks, Won

  69. Won Says:

    I noticed the tags got filtered out in my response just now, so here it is w/o the tag brackets:

    span id="ctl00_ctl18_iprRibbon"

  70. Won Says:

    Please disregard my previous request Waldek, my mistake. It was misplacement of a line in the master page, I finally found the cause. Sorry for the confusion,
    Won

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS
Copyright © 2007 - 2013 Waldek Mastykarz

Creative Commons License