Per Nergård (MVP)
+1
May 28, 2026
visibility 505
star star star star star
(0 votes)

Extending the Optimizely 11 Link Validation job with custom exclude patterns

This might be common knowledge but I have never done this in all my years working with Optimizely solutions.

On a customer I noticed that the link validation scheduled job had been failing for quite some time with the error: The scheme for the url "tel:00 000" in not http or https. So I needed to figure out if and how the configure the job to ignore certain patterns.

It turned out to be quite easy to just create a initialization module that hooked into the options for the job. Code snippet below and complete example on my Gist.

So adding that init module fixed the error and made the job to successfully run.

    [InitializableModule]
    [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
    public class LinkValidatorConfiguration : IConfigurableModule
    {
        public void ConfigureContainer(ServiceConfigurationContext context)
        {
            var options = new LinkValidatorOptions();
            options.ExcludePatterns.Add(@"^\s*tel:");
            options.ExcludePatterns.Add(@"^\s*mailto:");
            options.ExcludePatterns.Add(@"^\s*callto:");
            options.ExcludePatterns.Add(@"^\s*sms:");
            options.ExcludePatterns.Add(@"^\s*javascript:");
            options.ExcludePatterns.Add(@"^\s*skype:");
            context.Services.AddSingleton(options);
        }

        public void Initialize(InitializationEngine context) { }
        public void Uninitialize(InitializationEngine context) { }
    }
May 28, 2026

Comments

Tomas Hensrud Gulla
Tomas Hensrud Gulla Jun 17, 2026 10:51 AM

I think I would say it's common knowleldge, yes, but a reminder is very welcome!
 
I wrote about this years ago, and in CMS 11 (as you mention), you may also place these exclude patterns in web.config.
 
My blogpost from 2019:

error Please login to comment.
Latest blogs
Optimizely Commerce 14 Now Supports .NET 10

In my previous post, Optimizely CMS 12 Now Fully Supports .NET 10 , I noted one remaining limitation: Commerce 14 (Commerce Connect) did not yet...

Bien Nguyen | Aug 7, 2026

The Top 10 Things I'm Actually Using AI For

A while back I wrote about ReviewPR, an Azure Function that uses AI to review Azure DevOps pull requests. That was one specific use case, but over...

KennyG | Aug 5, 2026

Drag-and-Drop Reordering for Commerce Media Collection in Optimizely Commerce Connect

Optimizely Commerce Connect ships a polished asset editor for the CommerceMediaCollection  property on catalog entries. It lets editors add, remove...

Linh Doan Cuu | Aug 5, 2026

Order tabs with drag and drop V2

I earlier did a very simple Blazor version to be able to sort tabs with drag and drop. I wanted to update it a bit and also display how the tabs ar...

Per Nergård (MVP) | Aug 4, 2026