diff --git a/admin/blocks.php b/admin/blocks.php
index 17b0350..c1c569d 100644
--- a/admin/blocks.php
+++ b/admin/blocks.php
@@ -12,6 +12,8 @@
     $hide     = optional_param('hide', 0, PARAM_INT);
     $show     = optional_param('show', 0, PARAM_INT);
     $delete   = optional_param('delete', 0, PARAM_INT);
+    $instances= optional_param('instances', 0, PARAM_INT);
+    $deleteinstance= optional_param('deleteinstance', 0, PARAM_INT);
 
 /// Print headings
 
@@ -21,7 +23,7 @@
     $strhide = get_string('hide');
     $strshow = get_string('show');
     $strsettings = get_string('settings');
-    $strcourses = get_string('blockinstances', 'admin');
+    $strinstances = get_string('blockinstances', 'admin');
     $strname = get_string('name');
     $strshowblockcourse = get_string('showblockcourse');
 
@@ -96,6 +98,67 @@
             notice(get_string('blockdeletefiles', '', $a), 'blocks.php');
         }
     }
+    if (!empty($instances) && confirm_sesskey()) {
+        $actionurl = new moodle_url('blocks.php', array('sesskey' => sesskey()));
+        if (!$block = blocks_get_record($instances)) {
+            redirect($actionurl->out(false), get_string('blockdoesnotexist', 'error'));
+        }
+        if ($deleteinstance) {
+            $instance = $DB->get_record('block_instances', array('id' => $deleteinstance));
+            if(!empty($instance)) {
+                $context = get_context_instance_by_id($instance->parentcontextid);
+                if (has_capability('moodle/block:edit', $context)) {
+                    blocks_delete_instance($instance);
+                    $error = null;
+                } else {
+                    $error = get_string('nopermissions', 'error', 'delete: '.$instance->blockname);
+                }
+            } else {
+                $error = get_string('invalidarguments', 'error');
+            }
+            redirect($actionurl->out(false, array('instances' => $instances)), $error);
+        }
+        if (!$instanceslist = $DB->get_records('block_instances', array('blockname' => $block->name), 'id ASC')) {
+            //no instances found for block, redirecting to the Manage blocks page
+            redirect($actionurl->out(false));
+        } else {
+            $PAGE->navbar->add(get_string('blockinstancesof', 'admin', $block->name));
+            echo $OUTPUT->header();
+            echo $OUTPUT->heading(get_string('blockinstancesof', 'admin', $block->name));
+            $blockrenderer = $PAGE->get_renderer('block_settings');
+            $table = new flexible_table('admin-blocks-instances');
+
+            $table->define_columns(array('levelname', 'coursename', 'contextname', 'pattern', 'delete'));
+            $table->define_headers(array(get_string('context', 'role'), get_string('course'), get_string('page'), get_string('pagetypepattern', 'admin'), $strdelete));
+            $table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
+            $table->set_attribute('class', 'blocksinstancestable generaltable');
+            $table->setup();
+            foreach ($instanceslist as $instance) {
+                list($context, $course, $cm) = get_context_info_array($instance->parentcontextid);
+                if (!empty($course) && isset($course->id) && $course->id>1) {
+                    $coursename = html_writer::link(new moodle_url('/course/view.php',
+                            array('id' => $course->id)), format_string($course->fullname));
+                } else {
+                    $coursename = '';
+                }
+                $controls = array();
+                if (has_capability('moodle/block:edit', $context)) {
+                    $controls[] = array('url' => $actionurl->out(false, array('instances' => $instances, 'deleteinstance' => $instance->id)),
+                            'icon' => 't/delete', 'caption' => get_string('delete'));
+                }
+                $table->add_data(array(
+                    get_contextlevel_name($context->contextlevel),
+                    $coursename,
+                    html_writer::link(get_context_url($context), print_context_name($context)),
+                    $instance->pagetypepattern,
+                    $blockrenderer->block_controls($controls)
+                ));
+            }
+            $table->print_html();
+            echo $OUTPUT->footer();
+        }
+        exit;
+    }
 
     echo $OUTPUT->header();
     echo $OUTPUT->heading($strmanageblocks);
@@ -115,7 +178,7 @@
     $table = new flexible_table('admin-blocks-compatible');
 
     $table->define_columns(array('name', 'instances', 'version', 'hideshow', 'delete', 'settings'));
-    $table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strdelete, $strsettings));
+    $table->define_headers(array($strname, $strinstances, $strversion, $strhide.'/'.$strshow, $strdelete, $strsettings));
     $table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
     $table->set_attribute('class', 'compatibleblockstable blockstable generaltable');
     $table->setup();
@@ -143,7 +206,11 @@
             $strblockname = get_string('pluginname', 'block_'.$blockname);
         }
 
-        $delete = '<a href="blocks.php?delete='.$blockid.'&amp;sesskey='.sesskey().'">'.$strdelete.'</a>';
+        if ($blockobject) {
+            $delete = '<a href="blocks.php?delete='.$blockid.'&amp;sesskey='.sesskey().'">'.$strdelete.'</a>';
+        } else {
+            $delete = '';
+        }
 
         $settings = ''; // By default, no configuration
         if ($blockobject and $blockobject->has_config()) {
@@ -158,18 +225,11 @@
             }
         }
 
-        // MDL-11167, blocks can be placed on mymoodle, or the blogs page
-        // and it should not show up on course search page
-
         $totalcount = $DB->count_records('block_instances', array('blockname'=>$blockname));
-        $count = $DB->count_records('block_instances', array('blockname'=>$blockname, 'pagetypepattern'=>'course-view-*'));
-
-        if ($count>0) {
-            $blocklist = "<a href=\"{$CFG->wwwroot}/course/search.php?blocklist=$blockid&amp;sesskey=".sesskey()."\" ";
-            $blocklist .= "title=\"$strshowblockcourse\" >$totalcount</a>";
-        }
-        else {
-            $blocklist = "$totalcount";
+        if ($totalcount>0) {
+            $blocklist = '<a href="blocks.php?instances='.$blockid.'&amp;sesskey='.sesskey().'">'.$totalcount.'</a>';
+        } else {
+            $blocklist = "-";
         }
         $class = ''; // Nothing fancy, by default
 
diff --git a/lang/en/admin.php b/lang/en/admin.php
index e967be0..c66091e 100644
--- a/lang/en/admin.php
+++ b/lang/en/admin.php
@@ -69,6 +69,7 @@ $string['badwordsdefault'] = 'If the custom list is empty, a default list from t
 $string['badwordslist'] = 'Custom bad words list';
 $string['blockediplist'] = 'Blocked IP List';
 $string['blockinstances'] = 'Instances';
+$string['blockinstancesof'] = 'Instances of block {$a}';
 $string['blockmultiple'] = 'Multiple';
 $string['blocksettings'] = 'Manage blocks';
 $string['bloglevel'] = 'Blog visibility';
@@ -756,6 +757,7 @@ $string['order1'] = 'First';
 $string['order2'] = 'Second';
 $string['order3'] = 'Third';
 $string['order4'] = 'Fourth';
+$string['pagetypepattern'] = 'Page type pattern';
 $string['passwordpolicy'] = 'Password policy';
 $string['pathconvert'] = 'Path of <i>convert</i> binary';
 $string['pathdvips'] = 'Path of <i>dvips</i> binary';
