Thread Starter
dasfgh
(@dasfgh)
UPDATE: I changed back https to http in the database (search and replace) to see what will happen and the OGP data appeared again. The solution to this must be simple and I will work on it. If someone has a helpful advice, thanks in advance
If I understood it correctly, then you’re using https://ww.wp.xz.cn/plugins/open-graph-protocol-in-posts-and-pages/ that was last updated 6 years ago (and got closed in the plugin repo more than a year ago).
Nowadays there are many plugins available that can help you with optimizing your site for sharing on social networks. Virtually any SEO plugin will help you, for instance. And they will happily work with https, too.
The bad news is that you will have to migrate or redo your settings. If you’ve got a big number of posts and pages, then perhaps it would be useful to somehow export the data from the database and try to convert it. But if the number isn’t too big, then manually doing it may turn out to be quicker. The good thing, though, is that most SEO plugins by default reuse the standard meta-data that WordPress itself keeps track on – even if you change SEO plugin, a lot of these data will remain functional after your move.
PS! You can have a look at the HTML your site produces. If the only problem is that various links are http in the og: part, then Really Simple SSL might help you out. But that’s stopgap solution. You really shouldn’t be using something that hasn’t been updated for 6 years – it may start breaking other stuff, too.
Thread Starter
dasfgh
(@dasfgh)
Tor-Bjorn Fjellner, thank you. Yes, it is an old and neglected website with old plugins etc.
Fortunately, I was able to bring back the OGP data for most of the posts, but some is lost (for unbeknowst reasons) and now I’m entering it again manually.
As you said, I’ll try to export all that data (e.g. by going in MySQL and choosing export only of the OGP fields in post meta or smth like that, I’m not an expert, but I’ll try).
Now I’m afraid to install a new OGP plugin (not to lose what I already have).
Moving to HTTPS messes up everything (the FB shares, too, but that’s another topic, so I’ll discuss it separately).
Also searching and replacing http://yoursite.com to https://yoursite.com might break some things, but I will discuss that separately, too.
I hope that they will invent an automatic solution for such migrations. This is not good and it can ruin my (almost) 10 years of hard work.
Before you do anything of this: make sure to save a good backup.
As I said before: Any of the decent SEO plugins will give you og: markup nowadays. And they’ll primarily use the native data structure of WordPress, which makes you a bit more future-proof.
A couple of quick notes on your other questions:
When you start using https, then there are several things to keep track of.
– Google sees it as a new/separate site. You need to set up correct 301-redirection in order for Google to move the value to your https version.
– Any resources called inside your pages need to use https. Otherwise you get issues with mixed content.
– When searching and replacing, you need a plugin that correctly handles serialized data (URL’s entered in various settings pages, for instance). “Better Search&Replace” is usually good at this. (If you just change the URL, then the length declaration in any serialized data will mess things up for you.)
– A good stop-gap solution is the plugin “Really Simple SSL”. It filters the final html from your site and changes all links from http to https.
Thread Starter
dasfgh
(@dasfgh)
Thank you once again.
In the end I decided to enter the missing OGP data manually, cause it was not all lost, only in some posts. Why this happened, I dunno, but anyway.
I decided not to install any plugins, I was worried not to mess things more, and I also don’t want to “burden” the website.
Then I added this line to httaccess in the root to retreive the missing FB shares:
RewriteCond %{HTTP_USER_AGENT} !facebookexternalhit/[0-9])
Before that I’ve already added 301 HTTP-to-HTTPS redirect. I solved the non-secure images and videos issue by searching and replacing within the wp posts content only (I don’t touch anything else).
I also manually added a HTTP link to the OGP settings of each post (og url), and then I posted all links in the FB Batch Invalidator. It’s seems that I got the share count back.
So, all the problems are solved, except this one: https://ww.wp.xz.cn/support/topic/fixing-insecure-external-urls-in-media-library/
but that’s a separate topic. Thanks.
Oh. Now I understand what you meant about “losing” FB shares. Just like Google, I guess that they regard http and https as, basically, separate websites.