on-internet
← Community

How can I access and change the "image" in an html page's json-ld?

Stack Overflow ·

I want to access the "image" entry in the json-ld. At the moment, I am changing my whole site from http to https. I also might be changing the name of the site. So I want to access the "image" entry of the json-ld in javascript, so I can make this process easy to do at a moments notice by just changing the js file. For example, I alter the meta entry with this code as follows: let urlOLD = "http:\\myoldsite.com", urlNEW = "https:\\mynewsite.com"; document.querySelectorAll("meta[content]").forEach((meta) => { meta.content = meta.content.replace(urlOLD, urlNEW); }); <script type='application/ld+

Comments

Sign in or sign up to comment and upvote.

No comments yet.