# "Landing Page" Template Without Header and Footer

> Registers a "Landing page" block template for pages that shows only the page content, with no site header, footer or title, for campaign and sales pages (WordPress 6.7+).

- Type: PHP
- Runs: Run everywhere
- Category: [Block Editor](https://wpide.com/library/category/gutenberg/)
- Tags: templates, landing-pages, block-themes
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/register-landing-page-template/

## Code

```php
add_action( 'init', function () {
    if ( ! function_exists( 'register_block_template' ) || ! wp_is_block_theme() ) {
        return;
    }

    register_block_template( 'wpide//landing-page', array(
        'title'       => 'Landing page',
        'description' => 'Page content only, without header, footer or title.',
        'post_types'  => array( 'page' ),
        'content'     => '<!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} --><main class="wp-block-group"><!-- wp:post-content {"layout":{"type":"constrained"}} /--></main><!-- /wp:group -->',
    ) );
} );
```

## Notes

Choose it in the page sidebar under Template. Works with block themes; older WordPress versions are skipped.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find ""Landing Page" Template Without Header and Footer" 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/
