I have website I want to create SEO tags for in Umbraco. I was wondering how it is done? are there any best practice documents or advice?
I have website I want to create SEO tags for in Umbraco. I was wondering how it is done? are there any best practice documents or advice?
3
Answers
You need to have properties for those items inside each document which should have them and will be displayed / indexed etc. You can achieve the goal with couple ways:
You can create a small composition document type with all required properties (SeoTitle, SeoDescription, SeoKeywords and whatever you want more) and attach it to your document types (maybe even some master document type used for all webpages rendered and indexed across your site). Then you can create a partial view or render the values from it on the master template. In my opinion this way is giving you the best control over what’s there and we’re doing it for all of our projects (just importing exported composition doctype and attaching it to desired items in specific solution).
You can use a package e.g. https://our.umbraco.org/projects/backoffice-extensions/seo-metadata-for-umbraco/ which is doing exactly the same thing in a little bit different way, gives you the possibility to retrieve those properties from CurrentPage object. You can read more about the package here: https://ryanl.me/2015/04/13/seo-metadata-for-umbraco/.
Here’s how my company is doing it and how they taught me and it is working up until this very moment we are talking.
On your Settings, create a document type without a template and call it
SEO
. Then add the properties you want for your SEO there (and of course you can update them at any time). After that, create your Home Page and every other node as a child to the SEO tab and make them inherit the properties. That way in every page you create, the SEO properties will be inherited.Pro tip I learned recently. You can use GetPropertyValue for the SEO properties in each node as if it was the node’s properties to begin with. (No need to search
Ancestors
orDescendants
etc.Here’s how my Settings tab looks like:
Preview
I am not a SEO expert, but hopefully the code snippets below could get you started
Metadata
On the pages I have added some properties. If you do it by the document type, by inheriting or by compositions you could choose. I have the following properties defined.
Page title, which I aim to have a bit different than the page name. Not sure if it makes any difference – however I hope it will make some more of my focus words for the article either appear in the page title, or the page name. The page name i place in the
<head>
part, and the page title is used as a part of the article/main content.Page snippet, which I aim to have as short as possible, and mostly less than 160 characters. The page snippet is used in the article, as well as a summary for metadata.
Page tags, used for metadata keywords as well as for horizontal content navigation on the site.
Featured image, although not strictly a part of SEO, it is important as a part of the strategy to make the content friendly for social media.
Author, might be of importance for SEO, and I have a property for the main author, and as a member property I register facebook profile page.
I have started writing a razor macro, however it needs some more work, however works good for me. I place it as an macro run in the
<head>
part.Breadcrumb
A macro for making a breadcrumb with Microdata is useful for SEO.
SiteMap
I sitemap should be submitted to the search engines. A macro could be something like: