Per Nergård (MVP)
May 28, 2026
  53
(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

Please login to comment.
Latest blogs
Before Upgrading to Optimizely CMS 13: A Developer Checklist

A practical checklist for reviewing a CMS 12 solution before moving to Optimizely CMS 13.

Wojciech Seweryn | May 26, 2026 |

From websites to agents. Five takeaways from the Optimizely Partner Close-Up in Stockholm

Last week was the annual partner close-up event in Stockholm, Sweden, fast becoming a favourite Optimizely event of the year. An opportunity to mee...

Mark Welland | May 26, 2026

Visibility — The Six Audits I Run on Every Optimizely Engagement

Long-running content management systems accumulate problems that never throw exceptions. The Editor Power Tools audit family is six lenses on what...

Allan Thraen | May 26, 2026 |