Rewriting output of existing content block
You can try hook_block_list_alter() hook.

Act on blocks prior to rendering.

This hook allows you to add, remove or modify blocks in the block list. The block list contains the block definitions, not the rendered blocks. The blocks are rendered after the modules have had a chance to manipulate the block list.

You can also set $block-&gt;content here, which will override the content of the block and prevent hook_block_view() from running.