Use Filename for Alt and Title Tags
The alt tag already takes the filename but if for some reason you need to replace hyphens with spaces and include a duplicate title of the alt tag you can do something like: function wpse_120228_seomadness($html, $id, $caption, $title, $align, $url, $size, $alt) { $alttitle = str_replace(‘-‘, ‘ ‘, $alt); $img = get_image_tag($id, $alttitle, $alttitle, $align, … Read more