Home Forums Basel – Premium Template Remove unused CSS and Javascript on theme

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by Artem Temos Artem Temos 1 week, 4 days ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #256179

    nikosvl97
    Customer

    Hello, i checked the unused css on my front page and i saw that a total of 94% of the css is unused
    the file is style.min.css.

    how can i remove the unused code ? if i make it manually on the css child it will keep it ?

    any suggestions ?

    Private Content Hidden
    #256353

    Hello,

    Actually, if the code is unused on the front page it doesn’t mean that you can simply remove it. There are a lot of different elements and styles for pages that are not used on the front page but used on all other pages. That is why it is not possible simply to remove the CSS that you think is not needed on the home page since it will break other pages.

    Kind Regards

    #257193

    nikosvl97
    Customer

    i understand that. of course i will check all the pages that i am using. the question is if it will keep the changes if i am editing the file and save it in the child theme.

    #257240

    In this case, you will need to dequeue the file and enqueue it in the child theme.
    https://developer.wordpress.org/reference/functions/wp_dequeue_style/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.