Hop File Rename
Current Version: 1.0.0- EE7
-
Overview
Hop File Rename provides a CLI command and a Control Panel file manager action that renames files while preserving ExpressionEngine file safety rules.
It renames: - The original file - The thumbnail (
_thumbs) - Any generated/manipulated files (_resize,_crop,_rotate,_webp,_avif, and configured dimensions)The command-line utility can also simplify, rename and/or auto-increment a batch of files at once.
-
Installation
- Unzip the folder to a temporary location on your local hard drive.
- Upload the
hop_file_renamefolder to/system/user/addons/on the server. - Navigate to Add-ons in your EE control panel and install the add-on.
-
CLI Usage
php eecli.php hop_file_rename:rename_file <file_ids> [new_file_name] [--overwrite|--autoincrement] [--simplify]Examples:
php eecli.php hop_file_rename:rename_file 123 "new-file.jpg" php eecli.php hop_file_rename:rename_file "123|124|125" "new-file" --autoincrement php eecli.php hop_file_rename:rename_file 123 --simplify<file_ids>accepts both comma and pipe delimiters:1,2,3,41|2|3|4
-
CP Files Usage
On the file manager directory pages, Hop File Rename adds a
Renameaction for files to the action menu. It also adds a rename button to the file info page. Selecting either will display the rename dialog.The rename dialog allows you to enter a new filename. You can just start typing, and you do not need to include the extension — that will be reapplied automatically if you leave it off.
There is a checkbox to “Simplify filename,” which is optional.
To rename, click the Rename File button.
-
Renaming Behavior
- Extensions are always lowercased.
jpegis normalized tojpg.- If a new filename includes an extension, it must match the source extension (case-insensitive, with
jpeg/jpgnormalization) or the file is skipped with an error. - If a new filename omits the extension, the source extension is retained.
- If no
new_file_nameis provided, the current filename is used, and normalization rules still apply. - Multi-ID runs always auto-increment as needed and continue processing on per-file errors.
--overwriteis only valid for single-ID runs.--simplifylowercases the basename, strips all punctuation, and normalizes “-” and “_” separators.
Note: EE’s default file renaming always replaces spaces with underscores. “Simplify” uses the current EE
word_separatorpreference. -
Notes
- Uses ExpressionEngine models/filesystem APIs and file manager sanitization.
- No core files are modified by this add-on implementation.
- On some case-insensitive or mounted filesystems, case-only renaming (for example,
File.png->file.png) may not be possible. In those environments, the add-on returns an explicit error instead of reporting a false success.
-
Updating
- Download a new version from this website, and extract on your hard drive.
- Upload the new files to your system’s add-on directory.
-
Uninstalling
- Navigate to Add-ons → Hop File Rename and uninstall the module.
- Remove
system/user/addons/hop_file_rename/from the server.