WordPress 有名プラグインのCSSの読み込みをさせないようにする

2019-03-22 /
  add_action('init', array($this, 'remove_plugins_css'));

  protected function remove_plugins_css() {
    add_action('wp_print_styles', function() {
      // YARPP
      wp_dequeue_style('yarppWidgetCss');
      wp_dequeue_style('yarpp-thumbnails-yarpp-thumbnail');
      // AmazonJS
      wp_dequeue_style('amazonjs');
      // Tablepress
      wp_dequeue_style('tablepress-default');
    });

    add_action('get_footer', function() {
      // YARPP
      wp_dequeue_style('yarppRelatedCss');
      wp_dequeue_style('yarpp-thumbnails-yarpp-thumbnail');
    });
  }