What is the purpose of $node->data? the Node object reference has $node->date, which used for

Long date, including timezone data, of when the node was created.

May I use $node->data to store my own temporary variables?

  • How temporary is temporary? Do they need to be saved to the DB at any point?
    – Citricguy
    Commented Jul 9, 2012 at 3:07
  • In what context are you adding to $node->data? I wouldn't recommend using it as a container for any temporary variables, why not store those variables somewhere else, what brings about the necessity for using $node->data? Commented Jul 22, 2013 at 11:48

1 Answer 1


According to this page $node->data was used about Drupal 5 and is left there for legacy purposes only. It appears it's only purpose is to prevent "call to undefined property" errors. Do not use it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.