I want to deregister the script count.js of the Disqus Comment System plugin in WordPress. The script is in this location:
/wp-content/plugins/disqus-comment-system/media/js/count.js?ver=4.2.2
I try many different way, but nothing. Like this:
function prefix_my_scripts() {
wp_deregister_script('count'); /* I tried also 'dsq_count_script' */
}
add_action('wp_enqueue_scripts', 'prefix_my_scripts');
And also:
function prefix_my_scripts() {
wp_dequeue_script('count'); /* I tried also 'dsq_count_script' */
}
add_action('wp_enqueue_scripts', 'prefix_my_scripts');
I have seen that the plugin generate this script in this way:
wp_register_script( 'dsq_count_script', plugins_url( '/media/js/count.js', __FILE__ ) );
wp_localize_script( 'dsq_count_script', 'countVars', $count_vars );
wp_enqueue_script( 'dsq_count_script', plugins_url( '/media/js/count.js', __FILE__ ) );
After deregister i want to add the script inline before the close of body tag.
How i can do that?
The script is added by:
So you should remove it by:
You can paste the code in you (child) theme’s functions.php.