Create a gist now

Instantly share code, notes, and snippets.

Disable wp-admin and wp-login
<?php
/*
Plugin Name: Disable Admin and Login
Plugin URI: http://wordpress.stackexchange.com/a/106437/12615
Requires: PHP 5.3
*/
add_action( 'init', function()
{
$currentURL = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
if( strpos( $currentURL, 'wp-admin' ) or strpos( $currentURL, 'wp-login' ) )
{
wp_redirect( site_url() );
exit;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment