Remove YARPP CSS Files From Loading In WordPress

By Anil Gupta, 0  Tech Tips

Remove YARPP CSS files from loading in Wordpress. You can disable widget.css and related.css in functions.php to improve page load speed.


This article applies to YARRP (Yet Another Related Post Plug-in) for wordpress and how we can remove the YARRP specific CSS files that it loads automatically.

If you want to over-ride the YARRP’s widget.css and related.css files, the best way is to entirely disable them from loading at first.

This would save the bandwidth as well and would certainly help reduce page load time.

Add the following code to your WordPress active theme’s functions.php file.

To remove YARPP widget.css file:


// AM22 - Remove YARRP css files - START
add_action('wp_print_styles','am22_dequeue_header_styles');
function am22_dequeue_header_styles()
{
wp_dequeue_style('yarppWidgetCss');
}

To remove YARPP related.css file:


add_action('get_footer','am22_dequeue_footer_styles');
function am22_dequeue_footer_styles()
{
wp_dequeue_style('yarppRelatedCss');
wp_dequeue_style('yarpp-thumbnails-yarpp-thumbnail');
}
// AM22 - Remove YARRP css files - END

Remove YARPP CSS files

Remove YARPP CSS files

The above scenario would be more useful, if you are looking at using the YARRP custom template feature.