Practical guides

Clean up a web project without breaking the website

A large folder cannot be cleaned safely from filenames alone. Separate what serves visitors, what builds the site and what records interventions; check dependencies before deleting anything.

Go to the method

Screens displaying computer code on a desk
Stock photograph — Glen Carrie / Unsplash

Inventory files by purpose

Start with public pages and follow their includes, stylesheets, scripts and datasets. Add routes defined in server configuration and files loaded from calculated names. A photograph may be selected through a catalogue without appearing directly in the page code.

In a PHP project, include and require load other files, so a folder named scripts may contain essential code. Preserve configuration, secrets, keys and access settings. Generated files, such as translation dictionaries or image manifests, may also be needed on every page view.

Choose deletions you can explain

For each candidate, record its purpose, the references checked and the reason for removal. Audit screenshots and local reports are often candidates; an optimized image or font needs further checking. Compare the contents of copies before treating them as duplicates.

A missing literal reference does not prove that a file is unused: examine assembled paths, JSON lists and responsive variants. Work in small groups on a restorable copy. Keep a file when its dependencies remain uncertain and record what is needed to decide.

Verify and deliver a clean project

After each group is removed, open the main page families in every language. Check images, downloads, fonts, the sitemap, feeds and interactive features. Compare the results with the behaviour observed before cleanup, on a phone and a computer.

Record the file count, completed checks and limitations. Store backups outside the public root with suitable protection. Delete temporary verification files and stop test servers; production content, data and dependencies remain in the project.

Content updated on October 4, 2026

Acceptance matrix to adapt to your project

These proposed checks use synthetic cases. Decide the required behaviour with the team, record the result and assign unresolved gaps before release.

Test cases, expected outcomes and useful evidence
CaseExpected outcomeEvidence to retain
Included fileThe page renders without warnings or errors.URL and before/after result.
Responsive imageEvery variant in the manifest exists.Checked paths and dimensions.
Translated pageContent, navigation and links work.Language, URL and checked action.

Frequently asked questions

Should every folder named scripts or tools be deleted?

No. Its name does not establish its purpose. Follow calls from pages, configuration and data; remove only items whose role has been established.

Can the cache be deleted without checking?

Some caches regenerate; others store necessary data or need network access to rebuild. Check how they are created and replaced before deleting them.