Hide a list of blocks from Panelizer in-place editor (IPE) I have a list of blocks that shouldn't be added via panelizer IPE popup under manage content. Is there any way to remove them from the list?
One of the options is to extend the IPE controller to remove the unwanted blocks from display. Here are the code changes:


Route subscriber:


  mymodule.route_subscriber:
    class: Drupal\mymodule\Routing\RouteSubscriber
    tags:
      - { name: 'event_subscriber' }




Update the IPE controller:


&lt;?php

namespace Drupal\mymodule\Routing;

use Drupal\Core\Routing\RouteSubscriberBase;
use Drupal\mymodule\Controller\MymoduleIPEPageController;
use Symfony\Component\Routing\RouteCollection;

/**
 * Subscriber to update IPE controller.
 */
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    /* \Symfony\Component\Routing\Route $route */
    if ($route = $collection-&gt;get('panels_ipe.block_content_types')) {
      $route-&gt;setDefault('_controller', MymoduleIPEPageController::class . '::getBlockContentTypes');
    }
  }

}




Controller:


&lt;?php

namespace Drupal\mymodule\Controller;

use Drupal\panels_ipe\Controller\PanelsIPEPageController;

/**
 * Extends IPE controller for site specific customization.
 */
class MymoduleIPEPageController extends PanelsIPEPageController {

 /**
   * {@inheritdoc}
   */
  public function getBlockContentTypesData($panels_storage_type, $panels_storage_id) {
    // Assemble our relevant data.
    $types = $this-&gt;entityTypeManager()
      -&gt;getStorage('block_content_type')
      -&gt;loadMultiple();
    $data = [];
    $blocks_blacklist = $this-&gt;getHiddenBlockList();
    /** @var \Drupal\block_content\BlockContentTypeInterface $definition */
    foreach ($types as $id =&gt; $definition) {
      if (in_array($id, $blocks_blacklist)) {
        continue;
      }
      $data[] = [
        'id' =&gt; $definition-&gt;id(),
        'revision' =&gt; $definition-&gt;shouldCreateNewRevision(),
        'label' =&gt; $definition-&gt;label(),
        'description' =&gt; $definition-&gt;getDescription(),
      ];
    }

    return $data;
  }

 /**
   * List of blocks not available to add via PIE.
   *
   * @return array
   *   An array of block IDs.
   */
  protected function getHiddenBlockList() {
    // Remove UUID and title fields from the list.
    return [
      'entity_field:node:uuid',
      'entity_field:node:title',
    ];
  }


}