Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

How-to

Renaming many server files at once in FTP by Zaweba

Bulk rename in FTP by Zaweba renames many server files by rules (replace, regex, wildcard, case, numbering, clean-up) with a preview before anything changes.

Renaming many server files at once in FTP by Zaweba

Renaming a hundred files over FTP, one at a time, is the sort of job people put off for years. Bulk rename in the Disk view of FTP by Zaweba makes it a few minutes' work. You build a list of rules, see every old and new name side by side, and only then let it change anything.

The rules

Rules are applied from top to bottom, each one working on the result of the one before. Replace swaps one piece of text for another. Regex does the same with a regular expression, for patterns plain text cannot describe. Wildcard renames by pattern, such as *.htm to *.html. Case changes letter case. Add text puts something at the start or end. New name or number gives files a fresh name with a number, with a step, an order and the choice to start again in each folder.

Clean up gathers the fixes that web file names most often need: single spaces, no doubled hyphens or underscores, trimmed ends, accents removed, and web-safe characters only. Run on a folder of photos named by a camera or a phone, it gives names that sit happily in a web address.

Rules can be moved up and down, switched off or removed, so you can try an idea, see its effect in the preview, and take it out again without starting over.

The preview

Nothing changes until you have seen the result. The preview shows each file's current name and what it will become, so you can catch a rule that matches too much before it does any harm. Protected items are left out, so a broad rule cannot rename .htaccess or wp-config.php by accident.

After the rename

Renaming files on a website has a knock-on effect: anything that linked to the old names now points nowhere. FTP by Zaweba helps here. After files are renamed or moved on the server, a window lists references to the old paths in the linked local site, across .php, .html, .css, .js and .htaccess files. Tick the ones to fix, and Update references locally rewrites them in the same style they were written in. Then upload the updated files.

Renames also appear in the Disk operations log, where they can be undone as a batch with Undo this batch. If a rename turns out to be a mistake, you can reverse the whole batch rather than renaming files back one by one.

Jobs it suits

A site moving from .htm to .html files is the classic case, and the wildcard rule handles it in one line. Tidying an uploads folder full of photo names with spaces, capitals and accents is another, where Clean up and Case do most of the work. Numbering a set of gallery images so they sort in order is a third, with New name or number.

Mistakes to avoid

Do not forget links from outside the site. The link update window fixes references in your local site files, which covers your own pages, but it cannot change links on other websites or in search engines. Renaming a popular page or download changes its address for everyone, so think about which files people outside the site link to before renaming them.

Watch for rules that clash. A Replace near the top can change a name so a later Wildcard no longer matches it, or matches it unexpectedly. Read the preview from top to bottom with that in mind.

And keep an eye on content that refers to files in ways the link scanner does not cover, such as names stored in a database. If a site keeps image names in its database, renaming the files on disk will not change those records.

Used carefully, bulk rename takes one of the dullest jobs in website upkeep and makes it quick, predictable and reversible.