# Elementor Template Shortcode for the Free Version

> Adds a [wpide_elementor_template id="123"] shortcode that shows any saved Elementor template inside posts, widgets or other builders, without Elementor Pro.

- Type: PHP
- Runs: Run everywhere
- Category: [Page Builders & Themes](https://wpide.com/library/category/page-builders/)
- Tags: elementor, templates, shortcode
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/elementor-template-shortcode/

## Code

```php
add_shortcode( 'wpide_elementor_template', function ( $atts ) {
    static $depth = 0;

    $atts = shortcode_atts( array( 'id' => 0 ), $atts, 'wpide_elementor_template' );
    $id   = absint( $atts['id'] );

    if ( ! $id || $depth > 2 || ! class_exists( '\Elementor\Plugin' ) ) {
        return '';
    }

    if ( 'elementor_library' !== get_post_type( $id ) || 'publish' !== get_post_status( $id ) ) {
        return '';
    }

    $depth++;
    $html = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $id, true );
    $depth--;

    return $html;
} );
```

## Notes

Find template IDs under Templates > Saved Templates. Only published templates are shown.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Elementor Template Shortcode for the Free Version" 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/
