Software

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

    1. Unzip the folder to a temporary location on your local hard drive.
    2. Upload the hop_file_rename folder to /system/user/addons/ on the server.
    3. 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,4
    • 1|2|3|4
  • CP Files Usage

    On the file manager directory pages, Hop File Rename adds a Rename action 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.
    • jpeg is normalized to jpg.
    • If a new filename includes an extension, it must match the source extension (case-insensitive, with jpeg/jpg normalization) or the file is skipped with an error.
    • If a new filename omits the extension, the source extension is retained.
    • If no new_file_name is 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.
    • --overwrite is only valid for single-ID runs.

    • --simplify lowercases 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_separator preference.

  • 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

    1. Download a new version from this website, and extract on your hard drive.
    2. Upload the new files to your system’s add-on directory.
  • Uninstalling

    1. Navigate to Add-ons → Hop File Rename and uninstall the module.
    2. Remove system/user/addons/hop_file_rename/ from the server.

Have a Project for Us?

Request a Proposal