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:

exit;

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:

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

...

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. ;-)

Post a Comment

Your email is never shared.

Subscribe without commenting