Per Nergård (MVP)
+1
May 28, 2026
visibility 441
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
Finding Thomas Part 4 - The Intelligence Layer

I've been finding Thomas for a couple weeks now. Bear with me — we're almost at the full picture. Quick catch-up : Thomas is the returning visitor...

Ritu Madan | Jul 14, 2026

The Silent Success: When Your Optimizely SaaS CMS Config Push Succeeds with "0" Changes

  Picture this frustratingly common scenario in headless, code-first development with Optimizely SaaS CMS: You’ve defined a brilliant new element,...

Vipin Banka | Jul 13, 2026

Architecting an Enterprise-Grade Development Pipeline in Optimizely SaaS CMS

Most enterprise teams show up to Optimizely SaaS CMS with a clear roadmap for their release pipeline: DEV → QA → Stage → Prod. Four logical...

Vipin Banka | Jul 12, 2026

Bynder DAM Connector for Optimizely SaaS CMS: Improved Metadata Property Synchronization

While working with the Bynder DAM Connector for Optimizely SaaS CMS , one of the key areas I explored was how Bynder asset metadata is synchronized...

Vipin Banka | Jul 11, 2026