Skip to main content
WooCommerce guide

ImageObject Schema for WooCommerce Stores

By · Updated · 4 min read

How ImageObject Schema Works on WooCommerce

WooCommerce runs on WordPress, which means ImageObject schema implementation follows WordPress's own template and plugin conventions rather than a proprietary system. The image data itself typically comes from the WordPress Media Library, where every uploaded product photo already carries alt text, dimensions, and a file URL that can be pulled directly into a JSON-LD block.

This is a genuine advantage over platforms that store image metadata less consistently. Because WordPress has enforced a stable Media Library structure for years, a store with a reasonably well-maintained catalog usually already has most of the raw data an ImageObject block needs, even if it has never been surfaced in schema before.

What WooCommerce and Its Theme Emit by Default

A bare WooCommerce install with no SEO plugin emits no schema markup at all by default, image or otherwise. Most stores rely on an SEO plugin (Yoast SEO, Rank Math, or a dedicated schema plugin) to generate Product schema, and coverage of the image field varies by plugin and version. Some populate it as a bare featured-image URL, others build a fuller ImageObject automatically. Confirm your specific setup with Google's Rich Results Test rather than assuming.

This makes WooCommerce different from Shopify in one important way: there is no single default theme output to describe, since the schema entirely depends on which plugin, if any, is installed and how it is configured. Two WooCommerce stores can have completely different ImageObject coverage even on visually identical product pages.

Plugin-Based Schema Injection

Yoast SEO and Rank Math both generate Product schema for WooCommerce product pages, including an image field, through their respective schema graph systems. Neither plugin, in its default configuration, reliably populates license or creditText fields on that image entry, since those values are store-specific and not inferable from the product data alone. A dedicated schema plugin, or a small custom snippet, is usually needed to add those two fields.

Both plugins also offer a schema graph editor in their settings, which lets an administrator inspect and, in some cases, adjust which properties get output for a given page type without writing code. Reviewing that editor is a faster first check than assuming the plugin's defaults are incomplete.

Manual ImageObject via Template Overrides

For stores that want full control, overriding single-product.php or the relevant WooCommerce template part lets you write a custom JSON-LD block with a full ImageObject: contentUrl from wp_get_attachment_image_src(), which also returns the file's real width and height, caption from the attachment's stored caption field, and description from the image's alt text. This approach avoids relying on a plugin's specific schema graph implementation.

Template overrides are the right call when a store's SEO plugin output has a specific, persistent gap, such as missing license fields, that the plugin's own settings cannot fix. It is more maintenance-heavy than relying on a plugin, but it removes the dependency on any single plugin's schema roadmap.

Using WordPress Media Library Data to Populate ImageObject Fields

Every image in the WordPress Media Library already stores alt text, a caption field, and its native pixel dimensions, all retrievable through core WordPress functions like wp_get_attachment_image_src() and wp_get_attachment_caption(). This means most of the data an ImageObject block needs already exists in the database. It just needs to be pulled into the JSON-LD output rather than left unused. See schema markup for how this image data nests inside the broader Product schema block.

Actionable Steps to Audit and Fix ImageObject Schema on WooCommerce

Check five representative pages: the homepage, a product page, a product category archive, a blog post with an inline diagram, and any FAQ page. Run each through Google's Rich Results Test to confirm whether the image field is a bare URL or a full ImageObject. If your SEO plugin's output is incomplete, add a small functions.php filter or template override to backfill license and creditText fields, then re-validate.

Frequently asked questions

Does a bare WooCommerce install add ImageObject schema automatically?

No. Without an SEO plugin, WooCommerce emits no schema markup of any kind by default, including for images. Most stores rely on Yoast SEO, Rank Math, or a dedicated schema plugin to generate Product schema, and image field completeness varies by plugin.

Do Yoast SEO and Rank Math generate full ImageObject data for product images?

Both generate a Product schema image field, but coverage of properties like license and creditText is inconsistent and store-specific data that neither plugin can infer automatically. Verify your actual output with Rich Results Test rather than assuming full coverage.

Where does ImageObject caption data come from on WooCommerce?

The WordPress Media Library stores a caption field and alt text for every uploaded image, both retrievable through core WordPress functions. These values can be pulled directly into an ImageObject block rather than written manually for each product.

Can I add ImageObject schema without a plugin, using only template overrides?

Yes. Overriding single-product.php or the relevant template part and writing a custom JSON-LD block gives full control over every ImageObject property, pulling contentUrl, width, and height from wp_get_attachment_image_src() and caption or description from the attachment's stored metadata.

Does a WordPress theme update overwrite custom ImageObject code?

A theme update can overwrite a template override if it's edited directly in the parent theme rather than in a child theme. Placing custom template overrides in a child theme, which is standard WordPress practice, protects custom ImageObject code from being erased when the parent theme updates.

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 →