Change a page's social share info using wix code

I can change the social share information (like page title, description and image) using the wix editor via the page settings. My question is, am I able to change this using wix code based on a user input?

No as this can only be done by admin themselves through those settings.
https://support.wix.com/en/article/about-social-sharing
https://support.wix.com/en/article/default-seo-settings
https://support.wix.com/en/article/working-with-seo-settings-for-dynamic-pages

https://www.wix.com/corvid/reference/wix-router.WixRouterResponse.html#HeadOptions

@kaleb

Using Wix code you can change social share page Description, URL and Image. Code something like this…

let twitterShareUrl = (“https://www.twitter.com/intent/tweet?url=https://www.YourWebsite.com/Subpage&text=Enter%20Your%20Message%20Here”);

// place a twitter share image on your page and link it to the above URL

$w(“#twitterImage”).link = (twitterShareUrl);

//adding an image is a bit more tricky but can be done as follows.
//copy the URL from an image posted on twitter, URL has to start with “pic.twitter.com”.

let twitterShareUrlWithImage = ("https://www.twitter.com/intent/tweet?url=https://www.YourWebsite.com/Subpage&text=Enter Your Message Here pic.twitter.com/ybLlm6ysbC"))

$w(“#twitterImage”).link = (twitterShareUrlWithImage );

//modify above code to create dynamic links based on user input as required for your specific site

^ this. If you’d like a walk-through tutorial for a similar approach you can check out Code Queen Nayeli’s vid:
https://youtube.com/watch?v=cb31PIBP5LQ

That way site members can input their own social links, which you can store in a database.