Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
add_action( 'template_redirect', 'redirect_all_page' );
function redirect_all_page() {
if ( !is_home() ) { // get_the_ID() != 'home_page_id'
wp_redirect( home_url(), 301 );
exit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment