How do I temporarily block all access to a Wordpress website

I have a wordpress website that I want to take down temporarily. How do I do this elegantly and without changing anything so that I can easilty put it back up again.

Thanks
DavidHannenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DmitriyCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ray PaseurCommented:
Add the PHP die() command to the first-called script.  Probably either wp-blog-header.php or wp-config.php
0
gwkgCommented:
If you want to redirect to a page that describes why your site is down, put this code in functions.php.

function maintenance() {
  $url = "http://google.com";
  header("Location: $url");
  }
add_action('init','maintenance');

Open in new window

0
c_a_n_o_nCommented:
Another way without editing your WordPress or Theme files, is to add code to your .htaccess file that would deny access.  The site offers several options to choose from.
Source: http://25yearsofprogramming.com/blog/20070704.htm

Simplest method

ErrorDocument 503 "Our website is temporarily closed for maintenance. It should reopen by..."
RewriteEngine On
# TO ALLOW YOURSELF TO VISIT THE SITE, CHANGE 111 222 333 444 TO YOUR IP ADDRESS.
RewriteCond %{REMOTE_ADDR} !^111\.222\.333\.444$
RewriteRule .* - [R=503,L]
0
DavidHannenAuthor Commented:
Thanks - just what I was looking for
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WordPress

From novice to tech pro — start learning today.