Set Open Graph settings via custom code

I have a web page that takes parameters via the URL to create custom page content. This URL will likely be shared on social media and I’d like the custom page content to be reflected in the post.

How do I go about setting the Open Graph settings in the custom code?

Do you have something to show us?

Yep here you go

The text parameter is “test” and the image parameter is… well you see it lol.

I’d like for my Open Graph title to be the text parameter and the Open Graph image url to be my image parameter but I can only edit them in the page settings it seems.

Hmm, doesn’t seem to be possible with JavaScript, as the tags have to be written on the server side.

However, you might be able to use different share links for each social media like these:

Ah ok thanks. Think I might have to learn php for this one :sweat_smile: