Close a wordpress blog – keep site as it is but prevent hacks

Last summer I created a travelling-blog on my webspace to document my journey. Now the journey is over and I won’t put any new posts in this blog. I also don’t whish to have any new comments.

How can I close the blog (to make in invulnerable to external hacks, even if I don’t install any new upgrades) but keep all posts, comments, pictures, etc. as they are?

Read More

What I found is

Is one of them recommendable?

Is there another way to prevent all interactions with the page, so there’s no need to take care about wordpress (or plugin) updates, while still keeping the site secure?

Related posts

1 comment

  1. Why not just disable comments and registration?

    This comes to mind also:

    (Redirect all requests to login page or admin pages to homepage. A little irreversible.)

    $currentURL = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
        if (strpos($currentURL, 'wp-admin' ) or  strpos($currentURL, 'wp-login' )) {
                        header( 'Location: '.site_url() );
    }
    

    Caution: this stops you from logging in also.

    Edit:

    And adaptation of the above code put into plugin format can be found here. Thanks to brasofilo.

    Modified code:

    add_action( 'init', function()
    {
        $currentURL = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
        if( strpos( $currentURL, 'wp-admin' ) or strpos( $currentURL, 'wp-login' ) )
            exit( wp_redirect( site_url() ) );
    } );
    

Comments are closed.