My wordpress website is currently very slow as it has a lot of unused files and because people have worked on it since 4 years. I there a way I could check if a particular css or js file is being used anywhere in my website so that I could delete if not being used and make my website faster?
Asked
Active
Viewed 196 times
2
-
Does this answer your question? [Search for all occurrences of a string in a mysql database](https://stackoverflow.com/questions/562457/search-for-all-occurrences-of-a-string-in-a-mysql-database) – Justinas Sep 22 '20 at 06:43
-
How do you define "being used"? If the file is not included in the build / loaded in the html, then it wont contribute to the performance of the website. – Olian04 Sep 22 '20 at 06:43
-
1I doubt deleting unused files from the server would solve the performance problems. – Teemu Sep 22 '20 at 06:43
-
yes because they are big css and js files being loaded every time website loads – Shikhar Sep 22 '20 at 06:44
-
1Deleting won't help in making your website load faster. Since the files which aren't used aren't using any resources except storage which doesn't matter if you have enough storage. You need to find for those files which are linked to your HTML pages and check on f they are used or can be removed. That'll be helpful – OMi Shah Sep 22 '20 at 06:44
-
@OMiShah ohk..can you please tell how could I check that if a css/js file linked to html is being used or not – Shikhar Sep 22 '20 at 06:46
-
If the files are "_big css and js files being loaded every time_" then they are not unused. – Teemu Sep 22 '20 at 06:50
-
@Teemu why not if they are being called in the html but their classes or functions never being used then why not? – Shikhar Sep 22 '20 at 06:52
-
When you've a link to a resource, then it's counted as an used resource. When you've included extra resource links, you've to find them. How exactly, depends on how they are linked. If a link is dynamically created and its URL is built up of small parts, it's going to be hard, otherwise you could use your code editor, and search for the links server-wide. – Teemu Sep 22 '20 at 06:55