In Drupal 7 alt text for image field is usually missing, which is a big SEO issue, so here is a snippet that will add a default alt text based on the image style the current image is being printed.
Drupal 7 alt text for image field
I would suggest to make the alt text field mandatory for your clients so they have to fill it in with some actual good and informative information. But there is always the case for old content, most likely they will not go back and edit all the old content just to add alt text to them. So I would suggest you have some fallback text.
Having fallback text based on the image style it uses is an OK solution most of the times because based on the name of the image style you will know sort of where its being used.
Here is a snippet that you should paste in your themes template.php
function YOURTHEME_preprocess_image_style(&$variables) {
if (empty($variables['alt'])) {
if ($variables['style_name'] == 'main_image_style' ) {
$variables['alt'] = "This is the Main image of this post.";
}
} elseif ($variables['style_name'] == 'sidebar_image_style') {
$variables['alt'] = "Sidebar image";
} else{
$variables['alt'] = "";
}
}
}
Keep in mind that if you can not give it an alt text that would make sense in context because, maybe the image is being used just as a decorative element then leaving it empty is an OK fallback, as long as it’s get printed in html <img alt="" ..
Here is a blog post explaining when should an alt tag be empty.
I hope you found this useful. Let me know in the comments.
Cheers!