Subscribe on YouTube

Check out our videos on branding, web design, SEO, and online business.

How to Show Coming Soon Mode on Certain Pages

Home WordPress How to Show Coming Soon Mode on Certain Pages

In this video I will go over how you can activate a coming soon or maintenance page only on selected pages.

I will go over how to do this with only code so this will be a more advanced tutorial. But don’t worry I will walk you through all the code so you can understand how everything works.

Timestamps:

  • 0:00 Introduction
  • 2:10 Code Snippets Overview
  • 3:37 Part 1 – Page Redirects
  • 9:05 Part 2 – Blog Post Redirects
  • 11:24 Part 3 – Page Array Redirects

Part 1: Page Function Code

				
					add_action( 'template_redirect', 'redirect_to_specific_page' );
function redirect_to_specific_page() {
	if ( is_page('About') && ! is_user_logged_in() ) {
		wp_redirect( 'https://yourdomain.com', 302 ); 
  	exit;
    }
}
				
			

Part 2: Blog Post Function Code

				
					add_action( 'template_redirect', 'redirect_to_specific_post' );
function redirect_to_specific_post() {
	if ( is_single('Sticky Column') && ! is_user_logged_in() ) {
		wp_redirect( 'https://yourdomain.com', 302 ); 
  	exit;
    }
}
				
			

Part 3: Page Array Function Code

				
					add_action( 'template_redirect', 'redirect_to_specific_page' );
function redirect_to_specific_page() {
	if ( is_page( array('About', 'resources') ) && ! is_user_logged_in() ) {
		wp_redirect( 'https://yourdomain.com', 302 ); 
  	exit;
    }	
}
				
			

* Some of the links on this page are affiliate links, meaning we may receive a commission if you follow them. This allows us to continue providing free content and educational resources for you. Thank you for supporting our small business!

More Free Resources

Template Restyles

Get a new website in only 7 days with our new template restyle service. The perfect solution for a new business owner.