Skip to main content
improved the db query.
Source Link
Manu
  • 656
  • 4
  • 4

This question is quite old, but unanswered, so I'd respond for the record.

When you install Drupal with the standard install profile, some blocks (Search, Login, Navigation, ...) are enabled automatically.

So if you take a look in profiles/standard/standard.install, you will see that blocks are enabled with a db query and are relative to a theme.

So disabling a block is just an update query:

db_update('block')
  ->fields([
    'status' => 0,
  ])
  ->condition('theme', 'your_theme')
  ->condition('module', 'the_module_providing_the_block')
  ->condition('delta', 'the_block_delta')
  ->execute()
;

You may need to clear caches after that.

This question is quite old, but unanswered, so I'd respond for the record.

When you install Drupal with the standard install profile, some blocks (Search, Login, Navigation, ...) are enabled automatically.

So if you take a look in profiles/standard/standard.install, you will see that blocks are enabled with a db query and are relative to a theme.

So disabling a block is just an update query:

db_update('block')
  ->fields([
    'status' => 0,
  ])
  ->condition('theme', 'your_theme')
  ->condition('delta', 'the_block_delta')
  ->execute()
;

You may need to clear caches after that.

This question is quite old, but unanswered, so I'd respond for the record.

When you install Drupal with the standard install profile, some blocks (Search, Login, Navigation, ...) are enabled automatically.

So if you take a look in profiles/standard/standard.install, you will see that blocks are enabled with a db query and are relative to a theme.

So disabling a block is just an update query:

db_update('block')
  ->fields([
    'status' => 0,
  ])
  ->condition('theme', 'your_theme')
  ->condition('module', 'the_module_providing_the_block')
  ->condition('delta', 'the_block_delta')
  ->execute()
;

You may need to clear caches after that.

Source Link
Manu
  • 656
  • 4
  • 4

This question is quite old, but unanswered, so I'd respond for the record.

When you install Drupal with the standard install profile, some blocks (Search, Login, Navigation, ...) are enabled automatically.

So if you take a look in profiles/standard/standard.install, you will see that blocks are enabled with a db query and are relative to a theme.

So disabling a block is just an update query:

db_update('block')
  ->fields([
    'status' => 0,
  ])
  ->condition('theme', 'your_theme')
  ->condition('delta', 'the_block_delta')
  ->execute()
;

You may need to clear caches after that.