# SEO Checks

The SEO checker lets you put in a Url and run specific checks on the page to make sure you are using best practices. It's also part of the SEO Property.

<figure><img src="https://417697475-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVr2cbdfxDGZK1u2Fd59w%2Fuploads%2F8AkIi4IMy2rtriQwyosa%2FScreenshot%202025-02-12%20160715.png?alt=media&#x26;token=6836ade8-16f9-4b33-a2fc-79a41a5ed84e" alt=""><figcaption><p>SEO Checker built into the SEO Property</p></figcaption></figure>

The SEO Checker comes with a number of checks out of the box, but you can easily create your own. Just create a class that implements ISeoCheck

```csharp
public interface ISeoCheck
{
    string Name { get; }
    Task<SeoCheckResult> Check(string url, HtmlDocument document, Content.Models.Content content);
    int SortOrder { get; }
}
```

The example below shows the built in H1 checker that checks if the H1 is missing or if you have more than one H1 tag.

```csharp
public class HeadingOneSeoCheck : ISeoCheck
{
    public string Name => "H1 Checker";
    public Task<SeoCheckResult> Check(string url, HtmlDocument document, Content.Models.Content content)
    {
        var result = new SeoCheckResult(Name);
        var seoItem = new SeoCheckResultItem();

        // Select all H1 elements
        var h1Tags = document.DocumentNode.SelectNodes("//h1");

        if (h1Tags == null || h1Tags.Count == 0)
        {
            seoItem.Status = SeoCheckStatus.Error;
            seoItem.Message = "Page is missing an <h1> heading tag.";
            result.Items.Add(seoItem);
        }
        else if (h1Tags.Count > 1)
        {
            seoItem.Status = SeoCheckStatus.Warning;
            seoItem.Message = $"Page contains multiple <h1> tags ({h1Tags.Count}). Consider reducing to one for better SEO.";
            result.Items.Add(seoItem);
        }


        return Task.FromResult(result);
    }
    
    public int SortOrder => 1;
}
```
