Screenshot COVID-19 Update We have changed are structure to better support our employees and customers through these hard times.
See Updates

Never Expiring Access Token

Published: April 14, 2019 | Updated: June 11th, 2020
  1. Home
  2. Docs
  3. How To
  4. Never Expiring Access Token

If should be noted that setting an access token without an expiration is not considered “Best Practice”.

The core of WP OAuth Server is built using standard practice and stores all access tokens in the database without open to direct modification. If you desire to assign no expiration to access tokens, you can use a filter to modify the expiration time during the query.

Place the following code in the theme’s functions.php file

add_filter( 'wo_get_access_token_expires_return','wo_modify_expires_token' ); 
function wo_modify_expires_token( $expires ) { 
    return strtotime( '+99 years', $expires ); 
}
Icon