Remove stylesheet from front-page
-
Hi,
Currently, I am fighting to remove every single unused bit of data when loading my front-page. I am trying to score high in google page insight under mobile view.
I notice there are 3 unused CSS load at my front-page:
wp-includes/css/dist/components/style.min.css?ver=5.7
wp-content/cache/min/1/ajax/libs/font-awesome/5.15.1/css/all.min.css?ver=1616594077
wp-includes/css/dist/block-editor/style.min.css?ver=5.7Is there a function that can dequeue these stylesheets?
function dequeue_unused_css() { if (is_front_page()) { wp_dequeue_style('components'); wp_dequeue_style('block-editor'); } } add_action('wp_enqueue_scripts', 'dequeue_unused_css', 20);
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Remove stylesheet from front-page’ is closed to new replies.