What is og:image:secure_url used for?

The Citead team, updated

In short. og:image:secure_url supplies an alternate HTTPS image URL attached to og:image.

Definition: og:image:secure_url is an optional Open Graph structured property attached to og:image. It supplies an alternate image URL for a page that requires HTTPS.

Key facts

  • The Open Graph protocol specification places the property among the optional structured properties of og:image.
  • The specification describes og:image as an image URL that represents the object within the graph, and describes og:image:secure_url as an alternate URL to use when the webpage requires HTTPS.
  • The Open Graph RDF schema defines the property as a secure image URL that represents the object within the graph.
  • The schema gives the property the URL range, whose documented schemes are http and https.

Why is it used?

Open Graph metadata is added with <meta> tags in the page's <head>. The protocol uses og:image to identify an image that represents the page's object. og:image:secure_url provides another URL for the same image representation when the page requires an HTTPS resource.

The property belongs to the og:image group. The specification calls it a structured property because it adds metadata to a root property, using the same property and content attributes with an extra colon in the property name. It is optional, so a page can declare og:image without declaring this additional property.

How is it written in HTML?

The specification's full image example pairs an HTTP og:image value with an HTTPS og:image:secure_url value:

<meta property="og:image" content="http://example.com/ogp.jpg" />
<meta property="og:image:secure_url" content="https://secure.example.com/ogp.jpg" />

The root image tag comes first. The secure URL then describes the structured value associated with that image. The namespace schema describes both og:image and og:image:secure_url as URL-valued properties. Its URL datatype accepts a valid URL using the http or https scheme.

The other documented image properties cover the MIME type, width, height, and alternative text. The protocol describes og:image:alt as a description of what is in the image, rather than a caption, and says that a page specifying og:image should specify og:image:alt.

What happens with several images?

The protocol allows multiple values by placing multiple versions of the same <meta> tag on the page. It gives preference to the first tag from top to bottom during conflicts. Structured properties must follow the root tag they describe. When another root element is parsed, the earlier structured property group is complete and a new group begins.

This ordering matters when a page declares more than one og:image: an og:image:secure_url line should immediately follow the corresponding root image declaration, before another og:image starts a new group. The specification uses the same grouping rule for image width and height.

FAQ

Should you place og:image:secure_url in the document head?

Yes. The Open Graph specification places its metadata in <meta> tags in the page's <head>, and og:image:secure_url uses that same form.

Should you keep an og:image tag as well?

Yes. Declare og:image as the root image property, then place the secure URL as its structured property. The protocol describes og:image:secure_url as an optional property of og:image.

Can you use it to declare a second preview image?

The property supplies an alternate URL for the image represented by og:image. To declare another image value, use another og:image root tag and apply its structured properties after that tag.

Sources

  1. Open Graph Protocol, "The Open Graph protocol", undated
  2. Open Graph Protocol, "Open Graph protocol RDF schema", undated

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark