Use alt text to rename uploaded files and media

Use image alt text as the uploaded file name and title of the media to display in the library.

This forces users to provide alt text, and also makes it easier to name media items.

  1. Install Automatic Entity Label and File (Field) Paths modules.
  2. Configure Image Media image field.
  3. Set File (Field) Path settings > File name to [media:field_media_image:alt].[file:ffp-extension-original].
    • Optionally, adjust Cleanup using Pathauto and Transliterate settings.
  4. Configure Image Media Automatic label.
    • Automatically generate the label and hide the label field.
    • Pattern: [media:field_media_image:alt]