Disable blocks for certain pages How can I disable blocks (e.g., the menu block or the search block) from a custom module?

Concretely I have an access to my clients managed by a custom module, and I don't want anything appears on their access page except my company's logo.
If you want to change the visibility of many blocks at the same time, this module would be perfect:

https://www.drupal.org/project/block_visibility_groups


  Block Visibility Groups allows the site administrator to easily manage
  complex visibility settings that apply to any block placed in a
  visibility group. The visibility settings for all blocks in the group
  can be edited on one administration form.
  
  This modules works in conjunction with the Drupal 8 core's block
  administration system. It is a simpler alternative to modules like
  Panels.


Even you want to code this yourself, you can use this module as a starting point. The author of this module has a 2 hour video how this code was built.