WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't know how to make a plugin so I can't do what's suggested here How can I make it so the Add New Post page has Visibility set to Private by default?

so what's alternative ?

share|improve this question
up vote 5 down vote accepted

Found this on WordPress forums:

You can just add this to functions.php. I've tested once and seemed to work fine.

function default_post_visibility(){
global $post;

if ( 'publish' == $post->post_status ) {
    $visibility = 'public';
    $visibility_trans = __('Public');
} elseif ( !empty( $post->post_password ) ) {
    $visibility = 'password';
    $visibility_trans = __('Password protected');
} elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) {
    $visibility = 'public';
    $visibility_trans = __('Public, Sticky');
} else {
    $post->post_password = '';
    $visibility = 'private';
    $visibility_trans = __('Private');
} ?>

<script type="text/javascript">
        try {
            $('#post-visibility-display').text('<?php echo $visibility_trans; ?>');
            $('#hidden-post-visibility').val('<?php echo $visibility; ?>');
            $('#visibility-radio-<?php echo $visibility; ?>').attr('checked', true);
        } catch(err){}
    }) (jQuery);
add_action( 'post_submitbox_misc_actions' , 'default_post_visibility' );
share|improve this answer
Thank you very much just come back today and see your usefull answer :) – user310291 Oct 30 '11 at 15:51

The alternative would be to find someone else to make a plugin.

If you're using WordPress.com (meaning you can't install arbitrary plugins on your site), then you're out of luck. But for a self-hosted WordPress installation, you'll need to write a plugin and install it on your site. There are no alternatives when it comes to adding custom functionality.

share|improve this answer

Here is a video how to set up that easy. Good luck !


share|improve this answer
Answers should not rely on external links. Links die, and when this happen, your answer will be useless to future users. File an edit and post all relevant info and code from the video directly to your answer – Pieter Goosen Dec 6 '14 at 17:55
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – tfrommen Dec 6 '14 at 19:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.