> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Extending user login sessions on WordPress

> Extend WordPress login sessions with a simple theme file edit to stay logged in longer without repeated logins.

This article describes simple steps to get you a more extended login session on [WordPress](https://hosting.com/hosting/platforms/wordpress-hosting) instead of having to enter login credentials multiple times in a short time.

## Configuring login session time on Wordpress site

Follow the steps below to edit your Theme setting file:

1. Log in to your WordPress site with an administrator account.

2. On the **Dashboard** in the left sidebar, click **Appearance**, and then click **Theme Editor.** 🚧 Important
   > Important: You will not be able to roll back to your earlier Theme configuration after any edits. It is recommended to save the Theme file before proceeding with the edits.

3. On the **Theme Editor**, select the **Theme** you want to edit from the dropdown:\
   ![](https://static.hosting.com/kb/kb-wp-extendlogin-1.png)

4. The files for this selected theme is listed on the right column under **Theme Files**:\
   ![](https://static.hosting.com/kb/kb-wp-extendlogin-4.png)

5. Click on the file named "functions.php":\
   ![](https://static.hosting.com/kb/kb-wp-extendlogin-5.png)

6. Insert the following code into*functions.php*:

```javascript theme={null}
add_filter( 'auth_cookie_expiration', 'extend_login_session' );

function extend_login_session( $expire ) {

  return 31556926; // seconds for 1 year time period

}
```

7. Save the file and exit the editor.

8. The login session is now extended by 1 year instead of the default session by the login session cookie.

## Related articles

* [Changing a WordPress account username](/docs/changing-a-wordpress-account-username)

* [Changing the WordPress auto-save interval](/docs/changing-the-wordpress-auto-save-interval)
