How to auto redirect to the front page after login

Sometimes I’d like to go straight to my front page after logging in. This is extremely useful with themes like P2 which allow you to post from the front page, but may also come in handy if you don’t want your users to be put off by the admin interface.

There’s a very effective solution built right into WordPress. Usually you’d login with something like this:

This in turn is a shortcut that really calls the actual php file:

To redirect to the front page after login, just change that to

Thanks to Otto for this suggestion in the WordPress forums.

You can either bookmark this link or add it anywhere in your theme so you and your users can access it easily. If you’d like to build it right into a theme and call this via PHP you can make use of functions that generate the correct URLs for you:

More info in the WordPress Codex:

About Jay Versluis

Jay is a medical miracle known as a Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

Add your voice!