Per Nergård (MVP)
+1
May 28, 2026
visibility 388
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
Migrating from Find to Graph: Lessons Learned from a Real CMS 13 Project

While migrating a search solution from Optimizely Search & Navigation (Find) to Optimizely Graph in CMS 13, I encountered several issues that were...

Binh Nguyen Thi | Jun 24, 2026

Optimizely: Upgrade Opti-ID and .NET 10 in CMS 12

Many Optimizely customers are planning their roadmap around a future migration to Optimizely CMS 13. As a result, upgrades such as Opti ID adoption...

Madhu | Jun 23, 2026 |

Understanding Optimizely Graph: Caching, Webhooks & Avoiding Stale Content (Optimizely SaaS CMS)

📌 Scope: This post covers Optimizely CMS (SaaS) only — using the official @optimizely/cms-sdk and @optimizely/cms-cli packages with Next.js 15. If...

Kiran Patil | Jun 23, 2026 |

Optimizely Content APIs: the Setup the Docs Don't Walk You Through

CMS 13 is pushing things firmly in the direction of Optimizely Graph, but plenty of teams are still running on older CMS versions, or have good...

Andre | Jun 22, 2026

Translating content in Optimizely CMS with Anthropic Claude

An add-on with an Anthropic translator provider that lets you translate content in Optimizely CMS using Anthropic Claude.

Tomas Hensrud Gulla | Jun 20, 2026 |

Controlling Optimizely Forms Cookie Expiration in .NET Core

Learn how to make Optimizely Forms cookies behave as session cookies in CMS 12+ (.NET Core) using a simple middleware - and why the official...

Henning Sjørbotten | Jun 19, 2026 |