SEO is hard and sometime small things would help. Is there any way to get the image alt text, i added in the mediathek and which are shown correctly on GP, to all the image sizes which are shown on Homepage or Tag Page.
<img> alt attribute value is automatically fetched from the image’s “Alternative Text” in your media library.
GP archive also fetches the alt attribute the same way.
If you see a post within the list that doesn’t have an “alt” attribute value, that most likely means there’s no “Alternative Text” on your image file in your media library. You set this by finding the image in the media library and setting a “Alternative Text” on it.
That said, You shouldn’t need a snippet or script for this unless you want to fetch your alt attribute value from a different source other than the “Alternative Text”.