diff --git a/nodereference_count.module b/nodereference_count.module
index 5310936..18e5bd6 100644
--- a/nodereference_count.module
+++ b/nodereference_count.module
@@ -16,6 +16,7 @@ function nodereference_count_field_info() {
       'instance_settings' => array(
         'counted_reference_fields' => array(),
         'count_only_published' => TRUE,
+        'allowed_types' => array(),
       ),
       'default_widget' => 'nodereference_count_widget',
       'default_formatter' => 'nodereference_count_formatter_default',
@@ -73,6 +74,16 @@ function nodereference_count_field_instance_settings_form($field, $instance) {
       '#title' => t('Do not count references from unpublished nodes.'),
       '#default_value' => $settings['count_only_published'],
     );
+    $node_types = node_type_get_names();
+    $form['allowed_types'] = array(
+      '#type' => 'select',
+      '#title' => t('Count nodes that belong to these content types only'),
+      '#description' => t('If no content types are chosen, this restriction will be ignored.'),
+      '#options' => $node_types,
+      '#multiple' => TRUE,
+      '#default_value' => array_filter($settings['allowed_types']),
+      '#size' => max(4, count($node_types)),
+    );
   }
 
   return $form;
@@ -219,6 +230,9 @@ function nodereference_count_get_count($settings, $nid) {
     if ($settings['count_only_published']) {
       $query->condition('n.status', 1);
     }
+    if (!empty($settings['allowed_types'])) {
+      $query->condition('n.type',array_keys($settings['allowed_types']),'IN');
+    }
 
     unset($db[0]);
 
@@ -231,6 +245,9 @@ function nodereference_count_get_count($settings, $nid) {
       if ($settings['count_only_published']) {
         $select->condition('n.status', 1);
       }
+      if (!empty($settings['allowed_types'])) {
+        $query->condition('n.type',array_keys($settings['allowed_types']),'IN');
+      }
 
       $query->union($select, 'UNION ALL');
     }
