How do I hide "View most recent blog entries" If you enable the contributed Blog module, a link with the anchor text "View most recent blog entries" shows up on every post.  I want to hide this link using PHP (i.e. not resorting to css or javascript).

So far I've tried this in hook_node_links_alter():

unset($links['usernames_blog']['#links']['blog_usernames_blog']);


It doesn't work. I don't think the offending link is in the links array, but somewhere else (I've yet to figure out where).
unset($links['usernames_blog']['#links']['blog_usernames_blog']);


Might be correct, but make sure your module has higher weight, so your hook alter fires after the blog's module. 

I suggest using the weight module to give your custom module higher weight. Else, you could run on Devel's Execute PHP module_set_weight('mymodule', 11); to give it higher weight.



If that doesn't work, If you look at the module's code, there is another link that gets added via hook_ENTITY_TYPE_view

Thus, all you gotta do is use hook_ENTITY_TYPE_view_alter

mymodule.module

/**
 * Implements hook_ENTITY_TYPE_view_alter().
 */
function mymodule_user_view_alter(array &amp;$build, Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display) {
  if (!empty($build['summary']['blog'])) {
    unset($build['summary']['blog']);
  }
}