 

 [    ](https://www.facebook.com/sharer/sharer.php?u=https://www.skvare.com/markdownify/node/88&title=Limit%20Autosubscribe%20to%20Enabled%20Nodes "Share to Facebook") [    ](https://www.linkedin.com/sharing/share-offsite/?url=https://www.skvare.com/markdownify/node/88 "Share to Linkedin") [    ](mailto:?subject=Limit%20Autosubscribe%20to%20Enabled%20Nodes&body=https://www.skvare.com/markdownify/node/88 "Share to Email") 

 

 

#  Limit Autosubscribe to Enabled Nodes 

 

 

 [Messaging](http://drupal.org/project/messaging) and [Notifications](http://drupal.org/project/notifications) are popular Drupal modules that can be used for a website forum to notify original poster of replies, or an administrator of comments posted for a specific content type. When *'Set all users to "autosubscribe" by default'* is enabled in admin/messaging/notifications/content, it generates notification subscriptions even for node types that are not enabled. In other words, all nodes created by a user automatically get a new subscription. This may be troublesome, especially when creating new content on the site - at the very least creating numerous useless subscriptions. Drupal community provides a [patch](http://drupal.org/node/347986) that checks for allowed content types. As an alternative, these 5 lines of code perform the check. Add them on line 54. and the 'try' this test.

if ($type == 'thread') { $node = node\_load($value); if(!array\_key\_exists($node-&gt;type, notifications\_content\_types())) { return; } }

Simple and efficient solution!