Removing WordPress plugin CSS file
<p>I'm trying to removed a stylesheet which a WordPress plugin has included as I'm restyling the whole output of the plugin so don't require the stylesheet they've included.</p>

<p>The plugin in question is <a href="https://en-gb.wordpress.org/plugins/ai-twitter-feeds/" rel="nofollow">AI Twitter Feeds</a> which includes the following CSS file into my site:</p>

<pre><code>http://domain.test/wp-content/plugins/ai-twitter-feeds/css/aitwitter.css?ver=4.5.3
</code></pre>

<p>I've looked at the plugins file to see how it is being added and when I comment out the following line (225):</p>

<pre><code>wp_register_style('aitwitter', plugins_url('css/aitwitter.css', __FILE__));
</code></pre>

<p>in the ai-twitter-feeds/ai-twitter-feeds.php the stylesheet included in my website disappears.</p>

<p>From my searching online it appears that this should not be to difficult to remove but the example code I've found online doesn't seem to have worked, see below:</p>

<pre><code>function tmd_remove_plugin_assets(){
  wp_dequeue_style( "aitwitter" );
  wp_deregister_style( "aitwitter" );
}
add_action("wp_head", "tmd_remove_plugin_assets", 100);
</code></pre>

<p>I've also tried using the same function with two other hooks:</p>

<pre><code>add_action( 'wp_enqueue_styles', 'tmd_remove_plugin_assets', 20 );
add_action( 'wp_enqueue_scripts', 'tmd_remove_plugin_assets', 20 );
</code></pre>

<p>None of these have removed the script the plugin is including, is there some mistake I've made? Or another way to remove them?</p>