Password Protected Page Not Working when page set to page_for_posts
A professor wants to have a public site with a password protected blog so student writing is only visible to users in the class. The password-protect function works on a static page, but when set as the "posts" page in settings>reading the password function no longer works on the page.
Tested here on "blog" page: https://ell101spring19.commons.gc.cuny.edu/blog/
#1 Updated by Boone Gorges 2 months ago
- Tracker changed from Bug to Support
- Subject changed from Password Protected Page Not Working to Password Protected Page Not Working when page set to page_for_posts
- Status changed from New to Assigned
- Assignee set to scott voth
I'm afraid this is just a limitation in the way that page passwords work. It's only meant to protect the content of pages. When you set the page as the "Posts page" at /wp-admin/options-reading.php, you're no longer displaying the page content at all - you're just hijacking the URL of the page.
I'm assigning this ticket to Scott in case he's aware of a way to password-protected the post archive. My guess is that there is not, and the only option is to make the entire site non-public (Site Visibility at /wp-admin/options-reading.php)
#2 Updated by Laurie Hurson 2 months ago
Thanks for this explanation Boone.
Would a possible workaround be to PW protect a category archive (maybe with this plugin https://wordpress.org/plugins/access-category-password/) and then set that category as default in settings?
#3 Updated by scott voth 2 months ago
Hi Laurie - That plugin looks good, but I think you can also create a password protected page and then use a shortcode ("[su_posts]" using the "Shortcodes Ultimate" plugin that displays all the posts.
Or you could do the same with Gutenberg and add a widget (but I think right now you can only use 3 widgets and the "recent posts" widget is pretty limited - just shows title and date of post.)