Title: default content
Last modified: April 26, 2017

---

# default content

 *  Resolved [richard12](https://wordpress.org/support/users/richard12/)
 * (@richard12)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/default-content/)
 * Hi, I am trying to populate the private pages with default content. I am using
   this but it doesnt seem to work. I assume the post type is “private-page”? Is
   there something I am missing.
    Any pointers would be helpful. Thanks in advance
   Richard
 *     ```
       add_filter( 'default_content', 'pu_default_editor_content' );
   
       function pu_default_editor_content( $content ) {
           global $post_type;
   
           switch( $post_type ) 
           {
               case 'private-page':
                   $content = 'Default content for blog posts.';
               break;
   
               case 'page':
                   $content = 'Default content for pages.';
               break;
   
   
           }
   
           return $content;
       }
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [richard12](https://wordpress.org/support/users/richard12/)
 * (@richard12)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/default-content/#post-9069403)
 * Sorry found your support question with the answer.
    Thanks again
 *  Thread Starter [richard12](https://wordpress.org/support/users/richard12/)
 * (@richard12)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/default-content/#post-9073564)
 * Hi, Sorry to get back again. I used the code I found in another thread. It worked
   by adding default content but doesnt then let you add content. It just returns
   to the default content and removes any edits. I wonder if there is a modification
   that will allow one to edit the default content in the post text editor? Thanks
   for any pointers.
    Richard
 *     ```
       add_filter('wp_insert_post_data', 'wppbc_client_portal_default_content', 10, 2);
   
       function wppbc_client_portal_default_content($data, $postarr) {
   
           if ($data['post_type'] == 'private-page') {
   
               $data['post_content'] = '<p>Welcome to your private page. </p><br>';
   
           }
   
           return $data;
       }
       ```
   
 *  [Teodor Cosofret](https://wordpress.org/support/users/teodor-cosofret/)
 * (@teodor-cosofret)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/default-content/#post-9092567)
 * Hi,
 * Yes the custom code will add a default content but you will not be able to overwrite
   it. After you added the default content you will need to disable the custom code.
 * I know that this is not the best solution. The dev team already has in their 
   to do list the option to add a default content inside the Private Pages. This
   will be available in future updates.
 * Unfortunately for the moment I don’t have another solution for this issue.
 * Best regards,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘default content’ is closed to new replies.

 * ![](https://ps.w.org/client-portal/assets/icon-256x256.png?rev=1391969)
 * [Client Portal - Private user pages and login](https://wordpress.org/plugins/client-portal/)
 * [Support Threads](https://wordpress.org/support/plugin/client-portal/)
 * [Active Topics](https://wordpress.org/support/plugin/client-portal/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/client-portal/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/client-portal/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Teodor Cosofret](https://wordpress.org/support/users/teodor-cosofret/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/default-content/#post-9092567)
 * Status: resolved