S
S
Sergey Drobachev2020-05-29 09:57:23
css
Sergey Drobachev, 2020-05-29 09:57:23

How to remove extra CSS?

I wanted to optimize the site, speed up loading. I looked at PageSpeed ​​Insights for extra CSS files. Those files that were in the directory of the site itself, I deleted, accelerated. But what to do with those files that my site refers to, how to remove them or prohibit links to them. Help me please

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Orkhan Hasanli, 2020-05-29
@filthyded

hmm... it would be nice to clarify the question, since I saw several nested questions here:


How to remove extra CSS?

If we are talking about removing unnecessary CSS code, then you can download your project, open it in an IDE (Webstorm or any other Jetbrains product) and select unused css in the inspector.
Another option is to install an old version of fox before 52.
Find the add-ons listed here and clean up your site -
Dust Me Selectors
CSS usage

Attention! They don't work in new versions of fox!
https://stackoverflow.com/questions/7147441/firefo...
And here is an online service for removing unused CSS - https://unused-css.com/
But what to do with those files that my site refers to, how to remove them or prohibit links to them.

In the VI, styles and scripts are connected via functions.php (normally). Sometimes if this is self-written, you can see the connection of the code in header.php || footer.php
Do I understand correctly that you downloaded these styles and now you don't need external ones, since you already have them locally? If so, then install the query monitor plugin on your site, find the handle of these scripts and use it to wp_dequeue_style()remove
https://wp-kama.ru/function/wp_dequeue_style
https://ru.wordpress.org/plugins/query-monitor/

I
Ilyas M, 2020-05-29
@Brutt

Use the whois utility to find the email of the owner of the domain where the extra css is located. You can also use online services, for example https://www.nic.ru/whois/.
In a free form, make a request to this e-mail, to remove excess css, indicating a link to it. If the owner refuses, offer to at least rename the css file. With a 99% probability, the domain owner will not understand Russian, so the request must be made in English.
There is also an easier method. Find your website template and remove unnecessary css from there. But by doing this, you risk breaking the layout of your site. Make backups and go for it :)

I
Igor, 2020-05-29
@loonny

Search manually for tags with the address of the script. PageSpeed ​​Insights shows the URL of these styles. Ctrl + F press, the path to the style sheet, look for the tag, delete. <link>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question