5 votes


NOTE: For Umbraco v10/v13, use the Discipline package: 


which provides the functionality of the AutoNode, NodeRestrict, VirtualNodes, and VariantsHider packages together. 


Restricts the number of allowed published child nodes either via rules defined in a config file (parent doctype - child doctype) or via a special property in a single node (limiting the number of children of any doctype).

These two methods of defining restrictions can co-exist.

If the max number of allowed nodes is reached, new nodes will be saved but not published and a message (standard or custom) will inform the user of the restriction. The back-end can also optionally display warning messages before the max number of children is reached to inform the user of the restriction and the allowed number of child nodes remaining.

Usage (using configuration file in /config folder)

If you install the package, you will find NodeRestrict.config in your /config folder with a commented example of a rule.

Example nodeRestrict.config:

<?xml version="1.0" encoding="utf-8" ?>
<nodeRestrict propertyAlias="maxChildNodes" showWarnings="false">

You can define rules for parent/child sets based on document type as well as use a special property on any page that will define the number of allowed children (of any doctype) for that specific page only.

A rule has the following attributes:

: The document type alias of the parent of the document being published. You can alternatively use the "*" character here to match all document types.

: The document type alias of the document being published. You can alternatively use the "*" character here to match all document types.

: The maximum number of "childDocType" nodes allowed under a "ParentDocType" node.

: When set, displays warning messages regarding the number of nodes allowed if a rule is matched but the maximum number of children has not yet been reached.

: Overrides the standard message when the maximum number of nodes has been reached.

: Overrides the standard category literal when the maximum number of nodes has been reached. Standard literal is "Publish".

: Overrides the standard warning message when a rule is matched but maximum number of nodes has not yet been reached.

: verrides the standard category literal when a rule is matched but maximum number of nodes has not yet been reached. Standard literal is "Publish".

A rule is matched only when "parentDocType" and "childDocType" match. That is, the document being published must be of "childDocType" and its parent document must be of "parentDocType". In our example, the rule applies if we publish a "LandingPage" document under a "Home" document.

There are also two attributes on the root node itself:

: The alias of the property expected to be found in a document to limit its number of

. This must be a numeric property.

: Show warning messages in case a property with the "propertyAlias" is found but the limit defined there has not been reached.


Let's suppose that, on your site, you have pages of type "Advert" that you place under a page of type "AdvertList". You want to restrict the number of published "Advert" pages at any time to 3. You also need to display custom warning messages to let the user know that there's a limit there, as well as a custom message when the limit is reached. The rule you should create goes like this:

    customMessage="No more adverts for you. I saved your node, but you are only allowed 3 published adverts."
    customMessageCategory="Oops! Limit Reached"
    customWarningMessage="Remember that you will not be allowed to have more than 3 adverts published here."

Another far-fetched example would be to limit EVERY node in your site to having a maximum of 10 children, with no warning messages and a standard message when the limit is reached. To do that, you need a rule like the following:


The asterisk means "everything", as you may have guessed.

Usage (using document property)

Now let's suppose you have a single, specific node where you need to limit its number of child nodes to 5. In order to do that, you must specify the "special" property alias you need to use in the config file:

<nodeRestrict propertyAlias="mySpecialPropertyAlias" showWarnings="true">

And have a numeric property with alias "mySpecialPropertyAlias" in your document. Then you can go and set the number 5 on it. This will behave exactly like a rule, but only for the specific node.
If the node doesn't have a value for the "special" property, then this will be ignored.

The "showWarnings" attribute works the same way as in rules and it is global for all property-based restrictions. When applying a restriction based on the document's "special" property, it defines whether warnings will be displayed. If set to false, no warnings will be displayed (only a message when the maximum number of children has been reached).

So if your propertyAlias is, for example, "umbracoRestrictNodes" (this is the default, by the way) and you go on and add this property to a document and give it a value of 5, then that specific document will only allow for 5 published child nodes (of any type).


The "special property" limit (when the special property exists and has a value) overrides any defined rules that can apply to the same node.

Rules are processed top-down, so make sure the more general rules go to the bottom.

If a rule is processed, no more rules are evaluated.

If you add/edit/delete a rule, make sure you touch your web.config to get the application to restart and re-read the rules. Rules are read once on app start and cached for performance.

Version History

Initial Release

Bugfix - Bug in count when using wildcard (*) for child document type


 Download package
version 1.0.1

NuGet install instructions for Umbraco 7.4.0

Install-Package DotSee.NodeRestrict

Package owner

Sotiris Filippidis

Sotiris Filippidis

Sotiris has 1501 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions: 7.12.x, 7.11.x, 7.10.x, 7.9.x, 7.8.x, 7.7.x, 7.6.x, 7.5.x

Package Information

  • Package owner: Sotiris Filippidis
  • Created: 09/06/2016
  • Current version 1.0.1
  • .NET version 4.5
  • License MIT
  • Downloads on Our: 800
  • Downloads on NuGet: 12.3K
  • Total downloads : 13.1K

External resources