Set WordPress Posts To Private By Default

Paulund is full of premium tutorials and support to help with your development

Sign up to get full access to all tutorials.

Get full access for $5/mo

Login to your account


The following code snippet will allow you to set all your posts to private as default. We do this by using the action post_submitbox_misc_actions and inserting jQuery into the page to change the selected visibility setting. First this will check to see what the current post status is. If the post status is publish then we can set the visibility status to publish. Then we check to see if the post password is not empty, if the password is set we then set the visibility to password. We . . . This content is restricted to subscribers