Submit a enquiry

    Back to all posts

    Renaming images from uppercase to lowercase

    by Andrew Tebbott Developer

    Another tip from me 🙂

    During our WP All Import adventures described here – we had another issue when trying to import images. Depending on the origin and destination server, letter cases are handled differently, so if our import file stated image-name.jpg but the file was named Image-Name.jpg – the import of this image would fail.

    So we devised another Windows PowerShell script which converted all uppercase file names into lowercase.

    The process is:

    1. Open PowerShell: Right-click on the Start menu and select “Windows PowerShell” or “Windows Terminal” (if available) with administrative privileges.
    2. Navigate to your folder: Use the cd command to change to the directory where your files are located. For example: cd C:\path\to\the\files
    3. Run the script: Use the following PowerShell command to rename all files to lowercase:
    Get-ChildItem | Rename-Item -NewName { $_.Name.ToLower() }

    And that’s it, all your files should now be lowercase 🙂