How to change a WordPress featured image to https

Changing a WordPress featured image URL from http to https will not phase a PHP come WordPress Theme expert. For the rest of us, it is a nightmare!
Website Security cannot be compromised so Website Security must be #1 on your Priority List
So consider cutting your losses and going round the problem. If you “avoid” the featured image feature the problem goes away. If your site (like this one) isn’t big on images you can use the “Add Media” button to slot in images as and when you need them.

Adding your own media brings the problem under your control. The http/https link is now in your WordPress editor box and changing it is easy.

Why the Problem Happens

Theme designers will stare you in the face (or face you down in their Help Wikis) and tell you “The problem is not with the theme”.

Often the problem is one of timing – if your site was “http” when you created the featured image and/or the post – and then you change it to https – your featured images will continue to use the original http URL.

Try it – now that you have https – try creating a new post with a new featured image. Usually the “theme works fine” (unfortunately) and comes up with the https URL.

If you slot into this bucket you don’t need to “cut and run” by switching off the featured image feature. Assuming your site is still young. If your site has hundreds and thousands of pages – you need to consider the below solutions.

Data Fixing the URL

If your theme has hard-coded the URL into the post text – then a “database sweep” can rectify matters. Ensure first that the theme works properly with https – so your only problem is the legacy URLs – not the ones created from now.

Another option is to hook into the page as it is being parsed by the multitude of Plugins, Theme, WordPress things – and subtly make the switch. This way the data stays the same – but you add functionality to rectify the matter.

Leave a Reply

Your email address will not be published. Required fields are marked *