Reputation: 2783
I've website with MVC3 which is not coming up in Google search. As part of SEO optimization, I want to put the meta tags in _layout.cshtml. Is it good to put meta tags only in master page or in the content page as well? What is better technique for SEO? The meta tags are static. Thanks in advance.
Upvotes: 0
Views: 439
Reputation: 2004
Example:
_layout.chtml
<head>
<title>@Html.Raw(ViewBag.Title)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
... other common tags
@RenderSection("Meta", required: false) // your section
...
</head>
in custom page you should use
@model SomeModel
@section Meta
{
<meta name="description" content="your custom tag" />
// other custom tags
}
// some html or other code
Upvotes: 2
Reputation: 5286
Since the meta tags are placed on the head
, they should be placed only on the layout. You may also want to check the article "SEO is more than meta-tags and good content"
Upvotes: 0