# Drupal and how to disable notifications for programmatic node updates — Liran Tal

Programatically working updates on Drupal nodes with node_save() hook

Canonical: https://lirantal.com/blog/2013-02-05

![Cover artwork for Drupal and how to disable notifications for programmatic node updates](/_astro/photo-1468956398224-6d6f66e22c35.BePqp3CW_Zj88Tk.jpg)

More than often, we [Drupal](http://enginx.com/blog/disabling-notifications-programmatic-node-updates/drupal.org) developers find ourselves doing programmatic node modifications via the

```
node_save()
```

function. If you’re doing that as well as have [messaging](http://drupal.org/project/messaging) and [notifications](http://drupal.org/project/notifications) modules enabled in your site then given the case that your users have subscribed to content-type updates and you’re doing these ‘behind the scenes’

```
node_save()
```

stuff then you’re effectively spamming them with email updates each time you run that function.

To mitigate this issue, when saving a node programmatically you can set an attribute for the notifications module to understand that it needs not to send updates for this operation. It’s a quick and easy one:

```
function probably_your_hook(&$node) {
 // ... code ...

 // Disable announcements for this operation
 $node->notifications_content_disable = 1;
 node_save($node);

 // ... code ...
}
```

## More writing

[All writing](/blog)

*   Sep 5, 2026

    ### [Self-Hosting Hermes Agent with Matrix E2EE on Proxmox](/blog/self-host-hermes-agent-matrix-e2ee-proxmox)

*   Aug 2, 2026

    ### [The Practical Second Brain: Building an LLM-Operated Markdown Knowledge Graph](/blog/practical-second-brain-llm-markdown-knowledge-graph)

*   Aug 1, 2026

    ### [Building a Second Brain with LLMs and AI Agents](/blog/building-second-brain-llms-ai-agents)


* * *

Liran Tal is the author of the book [Node.js Secure Coding: Defending Against Command Injection Vulnerabilities](https://www.nodejs-security.com/)

[Start Building Secure Node.js Applications](https://www.nodejs-security.com/)

 [![](/_astro/nodejs-secure-coding-book-3d-style.DiTWpzFs_Z3c7s1.png)](https://www.nodejs-security.com/)
