Latest version: 0.2 – Released 28/03/2016
There is no built-in way for your visitors to “log out” of password protected posts once they’ve entered the password. Even logged in users cannot log out of password protected posts by logging out of their account. This plugin solves that problem by providing a link for your visitors to log out of password protected posts.
After installing the plugin, add
<?php do_action( 'posts_logout_link' ); ?> somewhere in your theme to display a link for logging out of password protected posts.
You can install this plugin directly from your WordPress dashboard:
- Go to the Plugins menu and click Add New.
- Search for Logout Password Protected Posts.
- Click Install Now next to the Logout Password Protected Posts plugin.
- Activate the plugin.
<?php do_action('posts_logout_link'); ?> somewhere in your theme.
Those people who are logged in to password protected posts will now see a link to log out.
For manual installation, see the guide to Manually Installing Plugins.
I can’t see a link to log out. What’s up?
Have you added the template tag somewhere in your theme? You need to add
<?php do_action( 'posts_logout_link' ); ?> somewhere in your theme for the link to show up.
I’ve added the template tag to my theme but I can’t see the log out link. What’s up?
Ensure that you have entered a password for a password protected post. The link will not show up if you’re not logged into a password protected post.
Can I change the default text in the link?
Sure. Add a second parameter to the template tag with the text you’d like instead. For example:
<?php do_action( 'posts_logout_link', 'Log out!' ); ?>
For those who want even more control, you can also add a third paramter which will be used as the class name on the link element.
Version 0.2 ZIP file from downloads.wordpress.org
Any comments, questions, queries, suggestions, complaints, etc, please leave a comment!
Latest version: 1.5.2
– Released 12/06/2019
- Minor code quality tweaks. No new features.
If you publish many password protected posts (or even if you don’t), you may end up using the same password for each one. With this plugin you can define a global password from your ‘Settings -> Global Post Password’ menu, and switch password protection on or off from the writing screen with just one click. Whenever you change the global password, all password protected posts are automatically updated with the new password.
Now whenever you write or edit a post or page you’ll be able to switch password protection on or off with one click, instead of having to manually type in a password each time. You can change the global password whenever you like from the ‘Settings -> Global Post Password’ menu.
Note that this plugin does not automatically enable password protection on every post. It allows you to use a global password for every post that you choose to password protect.
Please note that this plugin is no longer actively maintained. The global post password setting does not work with the block-based editor in WordPress and it’s unlikely that I’ll add support for it unless someone else volunteers to develop it. It does work with the “Classic” editor and with versions of WordPress prior to 5.0.
- Unzip the ZIP file and drop the folder straight into your
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- Visit the ‘Settings -> Global Post Password’ menu in WordPress and set a global post password.
Now whenever you write or edit a post or page you’ll be able to switch password protection on or off with one click, instead of having to manually type in a password for each post. You can change the password whenever you like.
Please see the plugin’s page on the WordPress Plugin Directory for more information, including FAQs.
ZIP file from downloads.wordpress.org
Any comments, questions, queries, suggestions, complaints, etc, please leave a comment below!