MVC: Modify page Title and Meta data

« Go Back


Article Number000071794
EnvironmentProduct: Sitefinity
Version: 7.x, 8.x, 9.x, 10.x, 11.x
OS: All supported OS versions
Database: All supported Microsoft SQL Server versions
Question/Problem Description
How to modify page Title and Metadata on a MVC pure page?
How to modify the default meta data for Feather widgets?
Steps to Reproduce
Clarifying Information
Error Message
Defect/Enhancement NumberFeature Request 171535

For Sitefinity 10.1 and below:

Customize the widget template and add the following code:

   var pageHandler = this.ViewContext.HttpContext.Handler.GetPageHandler();
   pageHandler.Title = Model.Item.Fields.Title + " custom";

To customize the widget template of a built-in MVC widget follow Sitefinity Documentation, Modify widget templatesMVC​

For Sitefinity 10.2 and later:

See article SEO: Automatic generation of metadata for widgets,

How to set up the meta title and description on a widget-level:
1) Go to settings > advanced > system > SEO and OpenGraph properties > On the page that loads, click Enable SEO properties
2) Go to Content > News and click Custom Fields for news, on the page that loads click add a field and add two fields:
2.1) Name: MetaTitle / Type: Short text > click continue > Make sure "Make localizable" is checked > click Done
2.2) Name: MetaDescription / Type: Short text OR Long text > click continue > Make sure "Make localizable" is checked > click Done
2.3) Click Save changes.
3) Go to a news item and fill in the newly created fields
4) Go to a page and place the News MVC widget > Click Edit > click Advanced > click MetadataFields 
4.1) in the MetaDescription field enter as a value - MetaDescription, since that is how the field is named per news item
4.2) in the MetaTitlefield enter as a value - MetaTitle, since that is how the field is named per news item
4.3) click save
4.4) Publish the page
References to Other Documentation:
Sitefinity Documentation, SEO: Automatic generation of Meta keywords, Meta description, and Meta title tags
Sitefinity Documentation, Modify widget templatesMVC
Sitefinity Documentation, Turn on Open Graph properties,
Sitefinity Documentation, Configure Open Graph properties,
Last Modified Date12/17/2018 6:32 AM

Did this article resolve your question/issue?


Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025