How to rename a content type programmatically There are many answers and tutorials addressing the problem of changing the machine name of a content type, or migrating content types. However, I would like to rename a content type, without changing the machine name. This is what I tried:

$type = node_type_load('my_content_type');
$type-&gt;name = 'A new name';
node_type_save($type);


But this has no effect. What is the proper way to do this?
Looking back on this after a year, I can't reproduce my own problem. This code works, even for content types defined by modules, not created through the UI:
$type = node_type_load('my_content_type');
$type-&gt;name = 'A new name';
node_type_save($type);