Filtering URLs and Images

XmlSitemapGenerator allows you to use expression based filters to exclude urls and images from your sitemap. Simple filter examples include :

  • /images/Temp/*
  • /TempFiles/*

However XmlSitemapGenerator uses standard regular expressions to enable more complex rules to be formed.

The topic of regular expressions is long and detailed so we have provided some external links below as well as some simple examples that you may find useful.

The below external websites cover the subject in more detail :

Regular Expression Examples

^/forms/.*$
Excludes any files in the "forms" folder.

^.*_printable_.*$
Excludes any files that contain "_printable_" anywhere in the path.

^.*_Old\.html*$
Excludes any files that end with "_Old.html".
Notice that we put a slash before the dot because normally the dot means any character, but in this instance we want to "escape it" i.e. remove it's special meaning and just match it as a full stop.

Latest blog posts

More on our blog >>

Sharing is caring

Please support us by sharing...