Hiding Comments Icon On oembed

I need to hide the comments icon on oEmbed widgets or disable the comments icon feature completely. I’ve been looking at the following links:


What I came up with after thinking for a while was this. I feel its a bit hacky, however it works. I copied the code from the_embed_site_title() and added inline style to display none at the end of it, then hook into with it a filter.

I added .wp-embed-comments{ display: none; } in the last $site_title variable before being returned.

function groovy() {
  $site_title = sprintf(
  '<a href="%s" target="_top"><img src="%s" srcset="%s 2x" width="32" height="32" alt="" class="wp-embed-site-icon"/><span>%s</span></a>',
    esc_url( home_url() ),
    esc_url( get_site_icon_url( 32, admin_url( 'images/w-logo-blue.png' ) ) ),
    esc_url( get_site_icon_url( 64, admin_url( 'images/w-logo-blue.png' ) ) ),
    esc_html( get_bloginfo( 'name' ) )
  $site_title = '<div class="wp-embed-site-title">' . $site_title . '</div><style>.wp-embed-comments{ display: none; }</style>';

  return $site_title;
add_filter( 'embed_site_title_html', 'groovy', 10, 2 );

Is there a better way?

Solutions Collecting From Web of "Hiding Comments Icon On oembed"