Ad

Where Should I Put An Image So That I Can Use It As An Og:image?

- 1 answer

I want to use an image in <meta property="og:image" content="" /> but I have that image in my file.

I know that we cannot use relative link in this.

<meta property="og:image" content="img/socialImage.png" />

Then where should I put this image so that I can use it in meta tag. How I can use my image as URL?

Ad

Answer

Once your application is hosted on a domain and publicly accessible your image will become accessible via web crawlers. At this point it can be picked up inside the og:image meta. All you need to do is host the image publicly on your application and put the full URL in the meta tag. For example <meta property="og:image" content="https://example.com/socialImage.png" />

Ad
source: stackoverflow.com
Ad