Skip to main content
How-to

How to Add ImageObject Schema to an Image

By · Updated · 4 min read

What Adding ImageObject Schema to an Image Involves

Adding ImageObject schema means writing a JSON-LD block, either standalone or nested inside a parent type's image property, that declares a specific image's contentUrl, caption, description, dimensions, and ideally its license and creator, so that search engines and AI systems can evaluate the image as a distinct, structured asset rather than inferring its meaning from surrounding page content. The process is the same whether the image is a product photo, a comparison chart, or an inline SVG diagram.

Step 1. Identify Which Images Deserve Their Own ImageObject Block

Not every image on a page needs its own block right away. Prioritize the featured image on product and article pages, since that one already nests inside existing Product or BlogPosting schema and carries the most weight for both Google Merchant Center and AI citation. Then move to standalone in-body diagrams and secondary product photos, which typically need their own separate ImageObject blocks rather than a shared one.

Purely decorative imagery, background textures, spacer graphics, and repeated site-chrome icons, does not need this treatment. Reserve the effort for images that carry real informational content: what a product looks like, how a process works, or what a comparison shows.

Step 2. Gather the Required and Recommended Property Values

For each image, collect: contentUrl (the actual file URL), a caption written for that specific image rather than a generic label, a longer description suitable for machine reading, width and height in pixels matching the actual rendered file, and encodingFormat (the MIME type, such as image/jpeg or image/svg+xml). Where the image is meant to be reused or credited, also gather license (a URL to license terms) and creator or creditText.

This step is where most of the real time goes, not the schema writing itself. If your media library or theme has never tracked accurate dimensions or captions, gathering correct values for dozens or hundreds of images is a data cleanup project in its own right, worth budgeting for separately from the schema implementation.

Step 3. Write and Place the JSON-LD Block

For a featured image already nested inside Product or Article schema, replace the bare URL string in the image property with a full ImageObject containing the values gathered in Step 2. For a standalone diagram or secondary photo, write a separate <script type="application/ld+json"> block with @type: ImageObject, and for inline SVG diagrams set contentUrl to the page's own URL plus a fragment id targeting the diagram's HTML id attribute. See the ImageObject schema pillar page for the full property reference and worked example.

Step 4. Validate With Google's Rich Results Test and Schema Markup Validator

Paste the live page URL into both tools. Rich Results Test confirms the block is recognized and flags missing required properties. The Schema Markup Validator gives a broader, type-agnostic check that catches malformed JSON-LD syntax errors that might not surface in a rich-results-specific tool. Fix any flagged errors before considering the block complete, and re-check that dimensions match the actual served file rather than a placeholder value.

Treat warnings and errors differently. An error means the block fails validation outright and needs a fix before moving on. A warning, such as a missing optional property like license, is a strengthening opportunity rather than a blocker, and can be prioritized based on which images matter most for citation.

Step 5. Monitor Through Search Console and Re-Validate After Theme Changes

Google Search Console's Enhancements report surfaces schema errors at scale across the crawled index over time, not just on the single URL checked manually. Theme and template updates on Shopify, WooCommerce, or Wix can silently overwrite custom schema code, so re-run validation on a sample of pages after any theme update, plugin update, or platform migration rather than assuming a working setup stays working indefinitely.

Keep a simple log of which pages carry custom ImageObject code, where in the template it lives, and when it was last verified. That log turns a vague "did this break" question into a five-minute check the next time a theme update ships, instead of a full re-audit of the entire site.

Frequently asked questions

How long does it take to add ImageObject schema to one image?

Once the property values are gathered, writing and placing a single ImageObject block is a few minutes of work. Gathering accurate width, height, and license data for images that were never documented in the first place typically takes longer than writing the schema itself.

Do I need to add ImageObject schema to every image on a page?

No. Prioritize the featured image on product and article pages first, then in-body diagrams and secondary product photos that carry real informational or citation value. Purely decorative images, like background textures, do not need their own ImageObject block.

What happens if the width and height I declare do not match the actual image file?

The schema will likely still validate without an error, since validators check for the presence and type of a property rather than cross-referencing it against the live file. But a mismatch undermines the accuracy of the structured data and can create confusion during any automated audit that does cross-check values against the served file.

Should I add ImageObject schema for images hosted on a CDN or third-party domain?

Yes. contentUrl should point to wherever the image file actually resolves, whether that is your own domain or a CDN subdomain. There is no requirement that the image be hosted on the same domain as the page referencing it.

Is there a checklist I can use to confirm I did every step correctly?

Yes. See the ImageObject schema checklist for a pass/fail item list covering required properties, licensing fields, and validation checks.

MG
Written by

Matt is the founder of RunOctopus. He built All Angles Creatures from zero to page-1 rankings in reptile feeder insects using exactly this method. Turning a hard, entrenched niche into RunOctopus's proof store for programmatic SEO and AI search citation.

Connect on LinkedIn →

See what Ollie would build for your store

Free architecture preview. No card required. Five minutes.

Generate Preview →