Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save amilabandara/e8a5c7428991365ff1d6defaf00500dc to your computer and use it in GitHub Desktop.
Save amilabandara/e8a5c7428991365ff1d6defaf00500dc to your computer and use it in GitHub Desktop.
Remove page templates from dropdown page attributes in WordPress ( >= 3.9 )
<?php
add_filter( 'theme_page_templates', 'rrwd_remove_page_template' );
function rrwd_remove_page_template( $pages_templates ) {
unset( $pages_templates['page_blog.php'] );
unset( $pages_templates['page_archive.php'] );
return $pages_templates;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment