View on GitHub

Marcel Digital

SEO Umbraco Extension

Umbraco extension to quickly create SEO friendly websites. The package includes a partial document type to add SEO elements to existing or new documents. It also comes with some child actions in order to render the SEO elements to site layout.

Please visit the project site on Umbraco here to report any issues or request enhancements using the forum.

All of the following properties are available in the SEO document type located in the Partials folder. Add the SEO document type as a composition to any document types which will add the SEO properties to the content.

Install

Install-Package MarcelDigital.UmbracoExtensions.SEO

Title

This property controls the output of the title for the content which will be rendered into the title tag. Title tags are used by search engines and are important for social sharing. Normally, the title of the content is the same as the name of the content in Umbraco, but sometimes this needs to be overridden. Use this property along with the SeoTitle() method on the Umbraco helper to output the title tag body.

<title>@Umbraco.SeoTitle() | [Your Site Name]</title>

When there is no value in the Title property, then the name of the content is used in it's place.

Meta Description

This property allows a description to be added to the content that provides a concise explanation of the contents. Search engines will use this to display preview snippets for your content in search results. Use this property along with the MetaDescriptionTag method on the Umbraco helper to render the meta description to the layout.

<head>
    ...
    @Umbraco.MetaDescriptionTag()
    ...
</head>

If there is no value in the Meta Description property, then no meta tag is rendered to the page. Otherwise the meta tag with the description entered is added to the page.

<meta name="description" content="[Your Description Here]">

To add a default meta description when there is none avaliable, pass the default text into the helper and it will be be used when the content has no value entered into the meta description property

<head>
    ...
    @Umbraco.MetaDescriptionTag("[Default meta description]")
    ...
</head>

Canonical Url

This property allows overriding the canonical url for the content. A canonical tag gives credit to a specific URL as the sole source of a piece of content or information. The property Canonical Override allows you to specify a different canonical url for the content in place of the url generated by Umbraco. Use this property along with the CanonicalTag method on the Umbraco helper to render the canonical tag to the layout.

<head>
    ...
    @Umbraco.CanonicalTag()
    ...
</head>

When there is no value for the Canonical Override property, the default Umbraco generated url will be used instead. The following tag will be rendered to the page.

<link rel="canonical" href="https://exmaple.com/path/to/contnet/" />

No Index / No Follow

These properties allow for setting the index and follow robots meta tag for your content. Setting content to "no index" will tell the crawler to ignore the content from its indexing, while setting "no follow" will inform the crawler to not pass link equity through any of the links in the content. Use these properties along with the RobotsTag method on the Umbraco helper to render the robots meta tag to the layout.

<head>
    ...
    @Umbraco.RobotsTag()
    ...
</head>

The following tag will be rendered to the page.

<meta name="robots" content="[no]index, [no]follow">

Hide from Xml Sitemap

This property is to be used in conjunction with creation of an XML sitemap for the Umbraco instance. If you do not already have a way to create an XML sitemap, see Marcel Digital's package for this here. Setting this property to true should tell the XML sitemap generator to omit this content from the sitemap.

Using our XML sitemap package, just add the following filter to the filter chain in the configuration file located at Config/xmlSitemap.config. This will remove any document types that have been flagged using the 'Hide from Xml Sitemap' property.

<umbracoXmlSitemap>
  <filters>
    ...
    <filter type="MarcelDigital.UmbracoExtensions.XmlSitemap.Filters.PropertiesFilter, MarcelDigital.UmbracoExtensions.XmlSitemap">
      <properties>
        <property alias="seoXmlSitemapHide" value="false" />
      </properties>
    </filter>
    ...
  </filters>
</umbracoXmlSitemap>