I am in the process of consolidating the SEO meta fields for the entire ASP.NET Core 8 MVC project. I have certain business logic written for each page to create unique SEO fields, some are database driven, some are based on the query string being passed to the page.
What is the best recommended approach to achieve this? I could be doing old traditional way.
Question: do we need all these fields mentioned below?
<title>Page Title</title>
<meta name="keywords" content=""/>
<meta name="description" content="Page Description"/>
<!-- Schema.org markup for Google+ -->
<meta itemprop="name" content="Sample">
<meta itemprop="description" content="Sample">
<meta itemprop="image" content="SampleImage.JPG">
<!-- Twitter Card data -->
<meta name="twitter:title" content="Sample">
<meta name="twitter:description" content="Sample">
<meta name="twitter:image" content="SampleImage.JPG">
<!-- Open Graph data -->
<meta property="og:title" content="Sample"/>
<meta property="og:image" content="SampleImage.JPG"/>
<meta property="og:description" content="Sample"/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-title" content="Sample">
<meta name="twitter:card" content="Sample">
<meta name="twitter:site" content="Sample">
<meta name="twitter:creator" content="Sample">
<meta property="og:type" content="article"/>
<meta property="og:site_name" content="Sample"/>
<meta property="fb:admins" content="Sample"/>
I have different approaches already implemented in the project.
Approach 1: I am populating SEO fields in the controller class, some section are being repeated.
Approach 2: For some pages I have it written in the .cshtml
page directly, still they are the combination of database and query string variables.
Approach 3: For some set of pages, I have common partial layout page, which is being called from the main layout and it populates the SEO fields
I have been going through many recommendations in this website on the similar line, but not able to conclude on the best approach. As I am happy to invest time & efforts on this process for long term perspective.