Disable wp-admin redirect in Ghost

Aug 27, 2015

Ghost by default has redirect settings, so WordPress users who have migrated to Ghost, can visit the same old /wp-admin url and get redirected to the /ghost url, to access the Ghost Admin.

This is a useful functionality for users who have migrated to Ghost, who didn’t have knowledge that Ghost uses /ghost instead of /wp-admin.

Some user would like to disable this feature, due to various reasons.

This can be done by editing the /core/server/routes/frontend.js file and changing the following lines.

From.

router.get(/^/((ghost-admin|admin|wp-admin|dashboard|signin|login)/?)$/, function (req, res) {  
        /*jslint unparam:true*/
        res.redirect(subdir + '/ghost/');
});

Remove wp-admin, the changes should look like:

router.get(/^/((ghost-admin|admin|dashboard|signin|login)/?)$/, function (req, res) {  
        /*jslint unparam:true*/
        res.redirect(subdir + '/ghost/');
});

Save the file.

Now restart Ghost, now Ghost will not redirect when you visit wp-admin, it will instead display 404 page.

Happy Blogging.

> [Add Contact form to your Ghost blog](https://darryldias.me/08/add-contact-form-to-your-ghost-blog/)
> [Live Tile on Ghost](https://darryldias.me/02/live-tile-on-ghost/)
> [Ghost on Pi](https://darryldias.me/09/ghost-on-pi/)
Have a question? leave a comment below.

If you like this content, please consider buying me a coffee.

Buy me a coffeeBuy me a coffee

You will get access to contributer exclusive resources and content.

Thank you!



Darryl Dias

I am a student, artist, and author currently living in Florida. My interests range from technology to arts. I am also interested in programming, writing

Analytics by GoSquared