views:

48

answers:

3

I'm developing a website, and after testing different ways to do things, I know that I have many files on my site that are not being used, including HTML/PHP files, images, stylesheets, and external scripts. Is there some program I can use or something so I can find all of the files that I don't need so I can delete them?

I need to find all files that are safe to delete, don't have anything to do with the site anymore, and that deleting them won't have any effect on how my site works.

I've tried finding orphaned files in Dreamweaver, but it lists a lot of files that I do actually need.

+1  A: 

Here's one idea: Crawl the site and create a list of every file you can find, then check anything that's not on that list. Wikipedia has a list of crawlers including some open source ones.

Brendan Long
Caveat: A crawler will not find dynamically-created content. That is, content that requires user interaction to provide, because the crawlers will not provide such necessary interaction. That said, this is still the method I would use, since dynamic content should be isolated in an obvious location and easy to exclude manually.
jdmichal
A: 

How would you qualify unnecessary? That's something you need to be sure of before beginning this. I guess one way to garbage collect your site is to delete files not being referenced by any other files.

Razor Storm
A: 

The idea with the crawler @Brendan to get all files that actually are used is very nice.

Then you can start deleting files from your website and after that use a program to find any broken links in your website like Xenu or LinkTiger or then one you prefer.

ppolyzos