How to Remove BBPress Styles from non-BBPress Pages
BBPress, ah how we in the WordPress community love to hate you. The forums software closely associated with everyone’s favorite CMS has made great strides in recent years, but it’s still not perfect.
For example, if you’re using the default theme, it calls a function which loads up a stylesheet intended specifically for BBPress pages, but which loads on every page of your website. In these days when load times are an SEO factor, you can’t afford to have a bunch of random stuff loading on your site that does nothing. How to remove it from irrelevant pages on your site then?
// remove bbpress styles from non-bbpress pages
function click_bbpress () {
if (!is_bbpress()) {
wp_dequeue_style('bbp-default');
}
}
add_action ('bbp_enqueue_scripts', 'click_bbpress', 15);
Paste that into your functions.php and you’ll be good to go.
Up Next: Vector Buffer App Icon