Images won't unlock

I enabled image locking feature and it wasn’t unlocking images when someone of that pledge level logged in. So I unchecked the feature and went to settings >permalinks and Saved again. Still not unlocking images. I tried deleting image and re-applying a new upload of the same image and it is locked too. This is on several images in the post but not on all images. The post does have 44 images.

This may be due to image-caching on the side of WP or the server. Or your browser.

Try ctrl+f5 after logging into the page via Patreon to see if the images will be unlocked. If they do, then its just due to caching.

Also, please make sure that you dont have ‘cache pages for logged in users’ or a similar option turned on in your caching plugin, if you have one.

Just in case anyone else is facing this, I was experiencing this issue too, and the problem was that my browser had the old locked images cached. I was able to hack together a solution with javascript.

First, add the class “NO-CACHE” to your images that you don’t want cached like this:

<div>
    <img class="NO-CACHE" src="images/img1.jpg" />
    <img class="NO-CACHE" src="images/imgLogo.jpg" />
</div>

Then I added this script

var nods = document.getElementsByClassName('NO-CACHE');
for (var i = 0; i < nods.length; i++)
{
    nods[i].attributes['src'].value += "?a=" + Math.random();
}

This forced the asset to load fresh on every reload and solved this problem. Hope this helps anyone else facing this pesky issue!

1 Like

Very nice solution.

Just in case anyone else is facing this, I was experiencing this issue too, and the problem was that my browser had the old locked images cached

This is a known problem affecting some sites and i already am to look into it in near future. But in the ultimate end, whatever we do, caching images is heavily dependent on users’ devices, and especially ISPs or other intermediaries. But we could mitigate it to some extent.