content type doesn't editable from UI There is a way to prevent the editing of my custom contet type from UI?
I have created my custom content type programmatically and I added a few fields and field groups.
The content type and fields must not be editable by UI but only from code.
I have tried to use the property 'locked' in hook_node_info() but without results, the content type is editable yet.
For ordinary users, you can just disable the "Edit any content" permission for the type in the Node section of Administration » People » Permission GUI:

However if you also need the to prevent user #1 (the default Administrator role) from editing, this will not work, since access controls are not enforced for that user.  Instead, you can implement hook_menu_alter() to override the access callback for the node edit page, and provide your own instead:

function MYMODULE_menu_alter(&amp;$items) {
  $items['node/%node/edit']['access callback'] = 'MYMODULE_node_edit_form_access';
}

function MYMODULE_node_edit_form_access($node) {
  $type = is_string($node) ? $node : $node-&gt;type;
  if ($type == 'my_type') {
    return FALSE;
  } 
  return node_access('update', $node);
}


(Please note that user #1 should normally be trusted to not do anything stupid, so you should not usually have to use access control tricks to restrain user #1.)

Alternatively, you prevent anyone (including user #1) from editing any field (e.g. the body field) by disabling access the field hook_form_alter.  You can do this with any field that makes up the content type.

function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'my_form_id') {
    $form['body_field']['body']['#disabled'] = TRUE;
    $form['body_field']['body']['#value'] = $form['body_field']['body']['#default_value'];
  }
}