Add this to your header.php file.
if(!is_user_logged_in()) {
wp_die('This site is currently undergoing maintenance.');
}
You can replace This site is currently undergoing maintenance.
with whatever message you want to show.
Related Posts:
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- How to add array [closed]
- WordPress website keeps loading the maintenance page
- Allow the access over wp-login.php
- PHP – redirect https to http and www to non-www
- Masking logout URL
- Logout/login redirect CSS issue
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- redirect wp-login.php to another page
- How do I redirect upon login a specific user based on role?
- Redirect if not logged in?
- Redirect a list of URLs to another URL, using functions.php
- is_user_logged_in not working to redirect only logged out users
- Ninja form Redirect depending on text field content [closed]
- Redirect specific page in WordPress for first time visit
- How do I redirect all 404 error url to Subcategory url
- Php function 301 redirect
- Stuck on maintenance mode
- How to Display Frontend CSS for Administrator only
- Redirect 404 page with ID in slug to associated page with same ID in slug
- 404 redirect to previous category
- Login Redirect if Logged in from Specific Page
- Redirect to another page if the user is logged in when pressing again the login button on menu bar
- Using wp_redirect and .htaccess to re-route searches (and pass along the remaining GET vars)
- Incorrect redirect after commenting
- Cannot modify header information – headers already sent (wp_redirect in functions.php)
- How i can put $_GET codes in function.php?
- Why does get_template_directory_uri() not include “www”, only for enqueued stylesheets?
- Page get parameter doesn’t work with is_single() function
- Contact Form 7 If Condition
- Solved: redirect to another page using functions.php
- Redirect to other page if login
- Logout Redirect and also WP-login.php Redirect
- Remove attachment page for audio media type only
- Redirects based on a JSON file
- template_redirect action only firing if logged in
- How to redirect Subscribers on login to specific page, when logging in from a Page
- Redirect to one of two pages after data submitted, depending on the current url
- Wildcard 301 Redirect Using Theme Function
- Competing Login Redirects – Need to be Combined?
- Postback redirect through add_action is not triggered
- Restrict access if logged out except for homepage
- Redirect specific author posts to another url
- Custom download page
- How to create a function to redirect a specified page to another page
- Language switcher for subdomains
- A blank page is shown after I add a Function
- How to request login for user but not for bots
- Template Redirect Function Only Working When Logged In
- Disable Attachment Page Except for Category
- Remove Actions/Filters added via Anonymous Functions
- Generating Responsive Background Image Sizes in PHP
- Redirect to login page
- Override a class function to include a custom template
- How to auto-update child posts whenever the parent post is updated?
- the_post_thumbnail fallback using hooks
- How to detect first visit of a user?
- Override woocommerce wc-class function
- How to limit character length in BuddyPress function output [closed]
- Is possible add icon in title posts only in specific tag?
- Wp_schedule_event functions.php
- Can’t generate thumbnail images
- Display tags that only appear in one category
- How to display retweet count and likes in the meta above the excerpt
- Auto Generated HTML source code formatting
- Get Comma Seperated Taxonomy Linked Terms and Last Child Separated By “&” Instead Of Comma
- WordPress redirect redirecting too many times or not at all
- How to remove a specific word at the beginning of the content and add it to the end of the content
- Programmatically add Yoast meta description after post save
- Exclude Category ID in function
- Where to store credentials used in a function? [duplicate]
- get_template_directory() – references parent theme directory
- Function that prevents users from uploading photos more photos
- Conditional function for excluding first image from content, not working
- WordPress comment_form() does not display actual comments
- Message notification for user
- Disable autosave with `function.php` for custom post wordpress?
- Is it possible to create a shortcode to link to a specific post/page where the tag is just an attribute?
- Different image using srcset function
- Save Meta when custom Taxonomy Saves
- Render metabox gallery in frontend
- Pagination not working – FrontPage
- What is the earliest Hook a Script can use?
- I want to display the sku in the product pages of my EDD website
- Adding new Category does not refresh the backoffice
- How do I make a custom “Read More Blogs” button for my blog page
- Get shortcode attribute value to another function
- Child theme style.css didn’t work properly but the Customize Additional CSS did [closed]
- True parameter but jquery register in header and not in the footer with wp_register_script
- previous_post_link inside of a function?
- Instead of using $post, how do i get the thumbnail image of the $post
- List Most Read Posts from last 7 days (with custom post type and other meta queries)
- Preventing PHP Execution in Parent Theme
- wp_upload_bits – define (sub)folder / (sub)directory before filename?
- How to shorten code with function?
- does acf_save_post cause endless loop?
- Should I use `get_stylesheet_uri()` or `get_template_directory_uri()` when calling my CSS Stylesheet?
- Missing argument 2
- User’s Comments Number: Storing it in a meta field for different uses
- Show one post per author and order by custom field