Skip to content

Instantly share code, notes, and snippets.

@hamidrezayazdani
Last active June 2, 2021 14:17
Show Gist options
  • Save hamidrezayazdani/2281e1a1de0937359ae04ca9bac1e6be to your computer and use it in GitHub Desktop.
Save hamidrezayazdani/2281e1a1de0937359ae04ca9bac1e6be to your computer and use it in GitHub Desktop.
Wordpress remember me cookie lifetime
<?php
/**
* Hook on auth_cookie_expiration
* The code goes in your theme/child theme functions.php
* You can also use this plugin: https://wordpress.org/plugins/code-snippets/
*/
add_filter ( 'auth_cookie_expiration', 'ywp_change_remember_me' );
function ywp_change_remember_me( $expire ) {
return YEAR_IN_SECONDS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment