I have a Google Sheet/Excel doc with unique Image Alt text for all of the images on my site. I'm looking for a way to bulk upload those, either using a plug-in, or through phpmyadmin.

Any help or advice that can be offered, is sincerely appreciated. Thank you.

  • Hi Mike, how did you fix this? Oct 14, 2022 at 4:36

1 Answer 1



  1. Converted to CSV file.
  2. uploaded to root folder having column structure as given which contains attachment image ID and alter text

CSV upload to your root folder

my type of csv file

  1. run this code for one time only
$row    = 1;
if( ($handle = fopen ( "Book1.csv", "r" )) !== FALSE ) {
    while ( ($data = fgetcsv ( $handle, 1000, "," )) !== FALSE ) {
        $image_id       = $data[ 0 ];
        $image_alt_text = $data[ 1 ];
        update_post_meta ( (int) $image_id, '_wp_attachment_image_alt', $image_alt_text );
    fclose ( $handle );
  • Hi Kirtan, is this solution better than using a plugin/WordPress webhook? My requirement is "There are 890+ unique images that are located in the Media Library that we can add ALT text to that should populate the page" Oct 14, 2022 at 4:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.