【WordPress】YARPP のCSSを削除する方法

WordPress で 関連記事 を自動で表示してくれるプラグイン「YARPP」。

この YARPP で使っているCSSファイルが重いので、削除することにした。

以下のサイトを参考にして、

以下のコード を function.php に追加。


// YARPPのwidget.cssを削除
add_action('wp_print_styles','crunchify_dequeue_header_styles');
function crunchify_dequeue_header_styles()
{
  wp_dequeue_style('yarppWidgetCss');
}

// YARPPのrelated.cssを削除
add_action('get_footer','crunchify_dequeue_footer_styles');
function crunchify_dequeue_footer_styles()
{
  wp_dequeue_style('yarppRelatedCss');
}