How to Close a WordPress Site

I recently was asked to close down a site I had put up using WordPress. I didn’t want to just delete the whole thing, as I figured somebody might want it put back up in the future. There are several easy ways to do this, but I think I’ve found the best.

My first impulse was to add an exit; line to index.php. The problem there is that it doesn’t close off the wp-admin section. I could comment out the database password in config, but that leaves a “Could not connect to database” message. I wanted every aspect of the site gone. Then it struck me: One file that absolutely every single call to WordPress must pass through is wp-config.php.

So if you want to “disappear” a WordPress site quickly and easily, just open up wp-config.php and add the following right after the opening PHP tag:


If you want to put up some kind of “goodbye” message in HTML, you can do something like this at the top of that file:

?><!DOCTYPE html>
<html><body><p>This site is closed.</p></body></html>


Even more briefly, of course, you could stick a short message inside a die() statement. The HTML gives you a bit more flexibility though.

Hope somebody finds this useful. ;-)

This entry was posted in 'Nuff said, Webcraft and tagged , . Bookmark the permalink.

4 Responses to How to Close a WordPress Site

  1. Navegante says:


    I was looking for this ;)

  2. Bob Austin says:

    This worked! I have been trying to do this without success. Now is there any way to put an Image rather than “out to Lunch”?

  3. Kunal Sharma says:

    Its very useful … Your trick is just an example of ‘Keep it simple Silly’ … :)

    I just wanted to make someone fool that there is some technical fault and I did it … ;) I’m your fan..

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>