How to redirect WordPress frontend to the backend

The first thing to do is to open your theme header.php file, and paste the following lines at the top of it:

<?php header("Location: ".get_admin_url());
exit(); ?>

Once done, your whole site is now redirected to your backend.

This recipe is based on this trick by Vladimir Prelovac.

Leave a Reply

Your email address will not be published. Required fields are marked *