Some files do not belong on a live web server, and your FTP client will happily upload them anyway. It has no opinions, which is both its charm and its flaw.
Leave out the .git folder. It holds the entire history of your project, and if the web server exposes it, a visitor can download your source code and old mistakes. Leave out node_modules, which can contain tens of thousands of files that the live site does not need. Skip cache folders, local debug logs and any file called backup, old or final-final2.
Be especially careful with database exports, .env files and notes that contain passwords. If they sit in a public folder, anyone who guesses the address can download them, and people do guess.
Also skip the local development settings from tools such as Local, because they point to your laptop, not your host.
A tidy upload is a quicker upload and a safer one. Before you transfer anything, look at the folder and ask a simple question: does the live site need this file to work? If the answer is “probably not”, you have your answer.
Credit: Thank you to Claude for writing this filler content. It is an unsupervised learning task.
Leave a Reply