Stop what you’re doing – it’s so much simpler!
function wpse_191369_post_password_expires() {
return time() + 10; // Expire in 10 seconds
}
add_filter( 'post_password_expires', 'wpse_191369_post_password_expires' );
That’s all you need.
Related Posts:
- Set Session Time Limit for Password Protected Posts
- pass-protected pages and posts not protected after enter them 1 time
- How to store or cache custom shopping cart data for every user’s session
- Password Protected Pages Don’t Accept A Valid Password After Changing The Password
- Why does enabling caching break password protected pages? Is there a way around this?
- W3 total cache – cache refresh programmatically [closed]
- Should I use Transient API to store HTML String, or Object?
- Caching: APC vs APCu vs OPcache
- Pros and Cons for high “expire time” on wp-super-cache or w3-total-cache? [closed]
- Limit cache size from W3 Total Cache [closed]
- Does a query executed through wpdb class get cached?
- Configuring WordPress for Amazon CloudFront Caching?
- Caching: Force fresh content for logged-in users (potentially by adding a query variable to the URL)
- Will I see a performance hit if I use native API calls like get_the_title() instead of $post->post_title?
- WordPress Browser Cache with W3-Total-Cache doesn’t show new posts [closed]
- Nginx + WordPress + HHVM: Why isn’t Batcache working? Would Varnish help even more?
- Does a low traffic WordPress site need a caching plugin and a CDN
- Automatically Refresh WordPress Stylesheet
- How to use cache with simplepie
- Fragment caching increasing database queries
- Can I force get_option to go back to the DB instead of cache?
- Settings to get the most out of W3 Total Cache
- How to force content refresh of a page that has been loaded previously by the user? [closed]
- Help Pinpointing Source of Caching Issue
- How to clear cache without a plugin [closed]
- Transient / object cache maximum key length [duplicate]
- APC object caching in combination Batcache/memcached page caching?
- Should the page cache be refreshed often? [closed]
- Plugin a specific cache functionality?
- What is difference between ‘Page Cache’ and ‘Object Cache’ in WordPress?
- Programmatically insert hierarchical terms & set terms for post causes glitch? [duplicate]
- How to totally disable cache in WordPress?
- Database Cache and Object Cache Difference?
- Register script version not showing
- When use a cache system with WordPress
- Method to make definitively static an abandoned WP blog
- How do I fetch feed info from cache instead of directly from feed?
- Transients are not expiring as expected in simple custom plugin
- WordPress caching issue
- How to speed up my site [duplicate]
- WP Rocket Cache Lifespan – Never clear cache? [closed]
- Disable feed cache for custom RSS feed?
- How do I enable dynamic content in a theme cached with WP Super Cache?
- Live website is not showing the changes I’ve made [closed]
- How to decode wordpress transient cache stored in database?
- Batcache messages no longer in page source
- After having installed APC Object Cache Backend transients stopped working
- WebHostingBuzz cache statement
- Are get_bloginfo queries cached to start, or should they be cached?
- W3 Total Cache can’t create files [closed]
- Files cached as CSS or PHP?
- Is it duplicated if I cache an object that uses data from postmeta?
- How to clear user’s browser cache after publishing a new post?
- A bunch of unrelated wordpress using same memcached don’t store correctly their datas
- Combile External JS files using W3 Total Cache [closed]
- How to be sure to get last page version without ANY cache?
- Is there a limit to size of data stored in update_option()?
- How can I cache font files on WordPress [closed]
- W3 total – leverage browser caching not working with cdn delivered images [closed]
- Browser cache for dynamic content (list of tags)
- How to specify expiration of cacheable resources? [closed]
- Scheduling doesn’t work due to caching?
- APC fragmention woes on Apache AWS EC2 Small instance with WordPress and W3TC [closed]
- w3 total cache – Object Caching 2165/2469 objects? [closed]
- Website working fine when logged in but not working fine when we logged out
- Best practices for the cache of a static WordPress site, including CDN Cache and Cache Plugin
- Site’s first loading on a new browser with no cache is messed up
- Site speed slows when user logged in
- Requiring a Visitor to Enter a Password Each Time They visit a Page
- WordPress mobile version is not responsive anymore after installing varnish
- Admin area is caching posts in the editor
- WordPress on mobile devices with new data after updating page
- Having issues fixing site speed
- Is there a way to cache WordPress that does not loads core?
- Need to refresh page after each change
- leverage browser caching in wordpress
- WordPress varnish pages printed twice
- Feed cache fallback – A feed could not be found
- WordPress Userroles button getting cached
- FATAL ERROR – white page – no site showing
- How to let users clear their posts cache with WP Super Cache?
- Having 4000 posts, my site is so slow
- GravatarLocalCache Plugin Broken in WordPress 4.2
- Super cache caches mobile pages for desktop
- Should I use transients for these API call results?
- My website resets when accessing the index page
- Debug Performance Issues
- cache reset button and question about deleting cache
- Cleared wp-cache and file is still not updated [closed]
- Bluehost WebHost and performance problems with W3TC [closed]
- get_theme_mod returning cached values regardless of apache restart
- Caching with dynamic content
- Levels of caching and impact on the WordPress web site
- CSS changes not taking effect [closed]
- what is the cache directory for in my theme? (version control it?)
- WP 3.5 caching problem
- Multiple WordPress sites eat up a lot of RAM
- Convert WordPress to static website by using the pages generated by the caching plugin?
- Cannot add version of main.css to wordpress on testing enviroment
- How to create a transient that persists the data for the whole duration of the expiration, even when object cache is enabled?