What Does "Invalid Content Type" Mean?

images linked on this page that have a "Content-Type" HTTP header that is not a valid MIME type for an image. It could mean that the URL linked in the <img> tag is not actually an image, so nothing will be displayed for this tag.

The Content-Type HTTP header is used to indicate what type of data is being returned by this URL, so that a web browser, search engine, or other clients know how to process this data.

A typical Content-Type header for an HTML page will like this:

Content-Type: text/html; charset=UTF-8

In this example, clients will understand that this URL is returning data that is text, specifically HTML code represented with UTF-8 character encoding. Similarly, a common content type value for images is "image/png" or "image/jpg". Common media types (MIME types) can be found on MDN web docs.

Why It's Important

It's important that the content type header matches the data returned by the URL so that web clients will process them correctly. If you include a URL in an image link that has the content type text/html, it's likely that this URL is not actually an image, so it will fail to load.

Therefore, having invalid content type for an image may be essentially the same as a broken image link.

How To Fix

Ensure the URLs are indeed images. If a URL is an image, you'll need to configure the server to return a valid image MIME type. If it is not an image, you'll need to replace the <img> src attribute with a URL of an image with a valid content type.

Did this answer your question?