# Cannot lock images when uploading and updating media

**URL:** https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518
**Category:** Uncategorized
**Created:** [December 10, 2019, 5:45pm UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518 "2019-12-10T17:45:46Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![pietrolc](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pietrolc](https://www.patreondevelopers.com/u/pietrolc)
#### Post date: [December 10, 2019, 5:45pm UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/1 "2019-12-10T17:45:46Z")

</div>

Hello,

I uploaded an image and set the minimum amount/tier required for that.  
Unfortunately, arghhh… It does not save my settings and the image is visible in my test post.

How can I fix this issue?

Thanks in advance

---

<div class="post-metadata">

### Author: ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)
#### Post date: [December 10, 2019, 11:57pm UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/2 "2019-12-10T23:57:15Z")

</div>

Have you turned on image locking feature in Patreon Settings?

---

<div class="post-metadata">

### Author: ![pietrolc](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pietrolc](https://www.patreondevelopers.com/u/pietrolc)
#### Post date: [December 11, 2019, 7:49am UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/3 "2019-12-11T07:49:39Z")

</div>

Yes, I did.

In the media library, I can only set and save correctly the required amount to see the image _in the single text line under the image_.

Instead, **the values set in the right-side box are never stored**.

I embedded a test image into a post and I was expecting that only the image was locked inside the post (i.e., a message should be shown?).

Instead, the image is always visible and linking to the patreon site.

Is that the expected behavior?

Many thanks in advance

---

<div class="post-metadata">

### Author: ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)
#### Post date: [December 11, 2019, 5:27pm UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/4 "2019-12-11T17:27:33Z")

</div>

If the image is linking to Patreon, then the image may have been locked, but your browser may not have refreshed the image and it may instead be serving the image from the cache. This would lead you to seeing the unlocked state of the image still.

Trying a hard refresh (CTRL + F5 for most devices/browsers) may help.

If you use a CDN like Cloudflare etc, that also may cause this kind of issue.

---

<div class="post-metadata">

### Author: ![pietrolc](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pietrolc](https://www.patreondevelopers.com/u/pietrolc)
#### Post date: [December 12, 2019, 11:53pm UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/5 "2019-12-12T23:53:36Z")

</div>

I made a test post. I’m expecting to have a hidden/locked image.  
Instead, the image is visible.

Please, check following URI:

> **[Testing locked img](https://www.pietrolc.com/testing-locked-img/)**
>
> bla bla bla

The cache is disabled for the post.

---

<div class="post-metadata">

### Author: ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)
#### Post date: [December 13, 2019, 12:04am UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/6 "2019-12-13T00:04:17Z")

</div>

Noted.

There are rewrite rules which must be present in your htaccess file for the image locking to work. They are:

# BEGIN Patreon WordPress Image Protection

RewriteEngine On  
RewriteBase /   
RewriteCond %{REQUEST\_FILENAME} (.png|.jpg|.gif|.jpeg|.bmp)  
RewriteCond %{HTTP\_REFERER} !^wp-admin [NC]  
RewriteRule ^wp-content/uploads/(.\*)$ index.php?patreon\_action=serve\_patron\_only\_image&patron\_only\_image=$1 [QSA,L]

# END Patreon WordPress

Please check your .htaccess file and verify that they are there.

Its possible that your host may be using Nginx or Multisite and therefore these rules may not come into effect. In that case contacting your host and asking about these rules may help.

---

<div class="post-metadata">

### Author: ![pietrolc](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pietrolc](https://www.patreondevelopers.com/u/pietrolc)
#### Post date: [December 13, 2019, 12:15am UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/7 "2019-12-13T00:15:35Z")

</div>

I have those rules in my .htaccess file.  
What should my hosting change?  
Can these rules be at the end of the .htaccess file?

---

<div class="post-metadata">

### Author: ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)
#### Post date: [December 13, 2019, 1:04am UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/8 "2019-12-13T01:04:59Z")

</div>

First of all contact them to confirm that what you have in your htaccess file is actually processed. Some hosts may have setups which do not recognize mod rewrite rules saved in htaccess files.

Order of placement of those particular rules should not matter. But they should be in the block they are.

---

<div class="post-metadata">

### Author: ![pietrolc](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pietrolc](https://www.patreondevelopers.com/u/pietrolc)
#### Post date: [December 13, 2019, 8:25am UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/9 "2019-12-13T08:25:44Z")

</div>

Ok, the problem cannot be fixed on my server.  
Thanks the same.

Just another question: should the locked post be always not cached? Thanks

---

<div class="post-metadata">

### Author: ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)
#### Post date: [December 13, 2019, 8:47am UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/10 "2019-12-13T08:47:27Z")

</div>

> Ok, the problem cannot be fixed on my server.

You can move to any standard hosting plan at any standard host, and you should be able to use the image lock feature.

Not caching locked posts is generally a very good idea. Its hard to predict where will caching kick in - at your server, your site, user’s browser, user’s ISP or any CDN that enters the equation.

---

<div class="post-metadata">

### Author: ![pietrolc](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pietrolc](https://www.patreondevelopers.com/u/pietrolc)
#### Post date: [December 13, 2019, 9:20am UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/11 "2019-12-13T09:20:54Z")

</div>

My hosting provider is using NGIX.  
It is bad I cannot use this feature.

---

<div class="post-metadata">

### Author: ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)
#### Post date: [December 13, 2019, 6:42pm UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/12 "2019-12-13T18:42:20Z")

</div>

The same rules can be effected in nginx. There is a relevant thread in the forum somewhere. WP Engine for example, allows you to add such rules in the below manner.

> [@Shortcode works, image locking by patron-level not working](https://www.patreondevelopers.com/t/shortcode-works-image-locking-by-patron-level-not-working/374/6):
>
> Can you please try doing what’s described below: In your WPEngine account/site settings, find the section to add url redirects. ‘Edit URL Redirect’ may be its title. If you cant find it, just ask WPEngine support. Then in that interface, enter the following values to relevant fields: Redirect Name: Patreon WordPress Image Protection Domain: All domains Source : ^/wp-content/uploads/((.\*?)(.png|.jpg|.gif|.jpeg|.bmp))$ Destination: index.php?patreon\_action=serve\_patron\_only\_image&patron\_…

The same rules can also be translated into nginx format manually.

---

<div class="post-metadata">

### Author: ![pietrolc](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pietrolc](https://www.patreondevelopers.com/u/pietrolc)
#### Post date: [December 14, 2019, 9:53am UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/13 "2019-12-14T09:53:24Z")

</div>

I cannot create this kind of redirects from my control panel (I’m using [SiteGround](https://www.siteground.com/recommended?referrer_id=8203337) ).

---

<div class="post-metadata">

### Author: ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)
#### Post date: [December 15, 2019, 8:29am UTC](https://www.patreondevelopers.com/t/cannot-lock-images-when-uploading-and-updating-media/2518/14 "2019-12-15T08:29:18Z")

</div>

You may be on their WordPress hosting, which is likely Multisite and hence doesnt allow rewrite rule changes.

If you move to one of their standard hosting plans, you can both have your WP site, install any plugin and also have WP automatically create the rewrite rules.

> **[Web Hosting Crafted For Top Website Performance & Speed](https://www.siteground.com/web-hosting.htm)**
>
> Web Hosting Powered By Superior Technology And 24/7 Support You Will Love! Plans At 60% Off With Easy Website Tools & Geeky Extras.

You can ask them which hosting account will allow you to do that. Any normal Linux hosting account with LAMP stack (linux, apache, mysql, php) would do. They would know.
