How to set Post Visibility Settings

| Last Updated: | In: WP Labs


Once you publish a WordPress post (or Page), it is visible to the public (by default). In WordPress terms, this means a post with a Published status has a default visibility of Public, based on the settings in the Publish box of a Edit Post Screen.

Checking Password protected reveals a text field for entering a password, that will be required to view that post. The password is limited to 20 characters.
Checking Private makes your post visible only to your site’s Users with the role of Administrator or Editor.

File-protected_content

Password Size Limitation

You can set the maxlength to a value of 20 when replacing the password protection form as WordPress will only save the first 20 characters due to database constraints.

Add the Password Form to the Excerpt

With the get_the_password_form function, you can make the password form be the Excerpt for a password-protected post:

Hiding Password Protected Posts

Copy and paste the following code in your theme’s functions.php:

Tags:


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:

Follow us!

Get Free Access of 380+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Free Guide: Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...

SEARCH NOW
Copyright © 2013-2017