No results found. Try again with different words?

Search must be at least 3 characters.

‹ BACK TO DOC

Remove Spectra Templates Button From Posts/Pages

Spectra offers an option to import ready-to-use templates directly from the block editor.

The plugin displays the ‘Spectra Templates’ button on the top of every page and post. This button opens up a window where you can import templates.

If you wish to remove this button and option to import templates, use the following custom code.

Note: Add the following code to your child theme’s functions.php

1) To disable the ‘Spectra Templates’ button from all posts, pages, and other post types.

add_filter( 'ast_block_templates_disable', '__return_true' );

2) To disable the ‘Spectra Templates’ button from pages only

add_filter( 'ast_block_templates_disable', function( $default = false ) {
	if (isset($_REQUEST['post_type']) && 'page' === $_REQUEST['post_type']) {
        return true;
    } elseif ('page' ===get_post_type($_GET['post'])) {
        return true;
    }
	return $default;
} );

Was this article helpful?


Did not find a solution? We are here to help you succeed.

Get access to growing library of 40+ innovative widgets and 300+ creative templates.

Ultimate Addons for Gutenberg Is Now Spectra - 

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Scroll to Top