How To Remove Recent Comment Styles In WordPress

Looking to make your website AMP-friendly by removing recent comment styles in WordPress? You can follow this guide to pass the AMP-validator test.

Removing recent comment styles using code

You can remove the recent comment styles by placing the code below into your WordPress theme’s functions.php file.

function recent_comments_style_removal() {
     global $wp_widget_factory;
     remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
}

add_action( 'widgets_init', 'recent_comments_style_removal' );

Removing recent comment styles without code

To remove the recent comment styles without the need to code, you can follow the steps below:

  1. Login to your WordPress Admin Dashboard
  2. Navigate to Appearance > Widgets
  3. Inside the active widgets, find Recent Comments and delete the widget