If you’re working on your local installation of WordPress, you know what its like being logged out all the time.
This code enables you to stay logged in forever.
You can modify the return value which in this case returns the I.D of the admin user which is 1.
Where to Put The Code
Simply add this code to the very end of your WordPress installations wp-config.php file.
The good thing about this code is you don’t even need to login when you start you machine, you’re always logged in and can’t logout unless you remove the code.
Great for Developers working locally all the time.
Was This Tutorial Helpful?