# Default Content for New Posts

> Pre-fills new posts or pages with starter content, such as a block layout or a checklist, so writers start from your template.

- Type: PHP
- Runs: Admin only
- Category: [Admin](https://wpide.com/library/category/admin/)
- Tags: admin, editor, template
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/default-content-new-posts/

## Code

```php
// Post type => starter content (block markup works in the block editor).
$wpide_default_content = array(
    'post' => "<!-- wp:paragraph -->\n<p>Intro: what will the reader learn?</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:heading -->\n<h2 class=\"wp-block-heading\">Main point</h2>\n<!-- /wp:heading -->\n\n<!-- wp:paragraph -->\n<p></p>\n<!-- /wp:paragraph -->",
);

add_filter( 'default_content', function ( $content, $post ) use ( $wpide_default_content ) {
    $type = $post ? get_post_type( $post ) : '';

    return ( '' === $content && isset( $wpide_default_content[ $type ] ) ) ? $wpide_default_content[ $type ] : $content;
}, 10, 2 );
```

## Notes

Only new items are pre-filled; existing content is never changed.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Default Content for New Posts" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
