
Quick Maintenance Mode Tip [WORDPRESS]
- Updated On 23/06/2016
- Author : Pradeep Kumar
- Topic : WordPress
- Short URL : https://hellboundbloggers.com/?p=23268
CONNECT WITH HBB ON SOCIAL MEDIA
When you are doing some serious maintenance work on your WordPress blog, you should make sure your visitors and readers don’t see that. Because it will be a mess right? If you hate plugins like me, then I have a simple tip for Quick Maintenance Mode.
Paste the following code on your functions.php file and save it. After completing your work, don’t forget to remove the code, or else it will display the same maintenance message to your visitors.
Feel free to customize the sentence “Maintenance, please come back soon.” and don’t edit any other code unless you know what you are doing, if you ask me I won’t touch it.
function wpr_maintenance_mode() {
if ( !current_user_can( ‘edit_themes’ ) || !is_user_logged_in() ) {
wp_die(‘Maintenance, please come back soon.’);
}
}
add_action(‘get_header’, ‘wpr_maintenance_mode’);
Thanks Skyje for this code.
Want to discuss your queries and interact with experts? You can connect with HellBound Bloggers (HBB) Facebook group for free!
Join HellBound Bloggers (HBB) and get Instant Updates. We'll also notify you with Great Deals, Discounts and other Interesting Tips. We won't SPAM or SHARE your Email Address with anyone.
YOU CAN ALSO SEARCH FOR YOUR DESIRED TOPICS:
Thank you for reading! We welcome and appreciate your comments, but at the same time, make sure you are adding something valuable to this article. If you have any serious queries, suggestions or anything related to this article, feel free to share them, we really appreciate that.
But, if your blog comments are a random "Thank you", "Useful Post", or anything that doesn't actually upscale the article, then we'll be removing them and it won't be appeared below. Thanks for understanding and thanks for connecting with us. If you want to give us any feedback or report any errors, you can kindly contact us and we'll revert back soon.
- Comments
- Facebook Comments
-
Comments
Leave a Reply
14 Comments
Facebook Comments
PS
Perfect solution for what i was looking for, THANX 😉
Satish
good one dude, i hope i would learn this coding like u 🙂
Kavya Hari
Thank you so much for your post on here 🙂 informative post Pradeep 🙂
Jasmine
Good tip. When I can see this message in action on HBB? Haha…
Oh, by the way, your blog has been awarded PR4 again. Congrats. 🙂
Praveen @ Geeks4share
Thanks for this post, and for the skyje link, it's really helpful 🙂
Swamykant
Thanks for the tips dude 🙂
Glorious Blogger
I often tweak my WordPress themes or layout so this tip comes in very handy for me. Thanks for sharing.
Shailendra Singh Bais
Wow, Really a very useful tool. Even I hate those Plugins. I think of doing something by myself. Searcg Google, end up in getting a Plug-In.. Really, frustating..
Himanshu
It cool . will keep this post handy. thanks for sharing
Shawn
Why do u hate plugins man? they are like lifelines for WP and the main thing that makes the use of WP infinite….
SHIVAM AHUJA
@SHAWN, excess plugins makes site load time more, hence affects the PR , and seo.
so instead of plugins,we should use code whereever possible
SHIVAM AHUJA
@SHAWN, excess plugins makes site load time more, hence affects the PR , and seo.
so instead of plugins,we should use code wherever possible
liaqat
plugin consumes server resources while self coding doesn't 😀
Atish Ranjan
because plugins slow down the site. Code works better.