Add itemprop=”image” to all WordPress images

Working with documentation, found that (almost?) all images use same attribute itemprop=”image”, so why not add it to all images.

Now You can download as plugin: Itemprop WP

! New way to add itemprop=”image” by using different WordPress filter wp_get_attachment_image_attributes

Here is my solution:

Script snippet: adding itemprop=”image”


On first row we add new filter to picture’s HTML output. Since we don’t care about other attributes, we simple grab must used attribute – src – and add to it itemprop=”image”.

… and search engines (Google, Yahoo, …) will love You more (because they support microdata, like

PS. just don’t forget to correctly markup rest of code :)

Look! Already 6 responses to Add itemprop=”image” to all WordPress images



hey, thanks for your plugin.

I installed it, but how do I know that it’s working?


Rolands Umbrovskis


Well, You can check source :)



Hi there,
when I check the page source, I don’t see any itemprops anywhere..




This shows only in source code. But still missing the following:

Warning: At least one field must be set for HatomEntry.
Warning: Missing required field “entry-title”.
Warning: Missing required field “updated”.
Warning: Missing required hCard “author”.

Rolands Umbrovskis


Hi, SEO!
This Your error code is not related to plugin, it’s error of Your WordPress theme.

You provided microformat data, but plugin is using microdata if



Hi, nice code and well implemented on WP. What about video, can we do the same? thanks

Leave a Reply

Your email address will not be published. Required fields are marked *