Allow Application Passwords on Local Sites Without HTTPS
Turns on Application Passwords for local and development copies of the site that run on plain http, so you can test REST API integrations and apps locally the same way as in production.
Opens WPIDE on
Code
add_filter( 'wp_is_application_passwords_available', function ( $available ) {
return in_array( wp_get_environment_type(), array( 'local', 'development' ), true ) ? true : $available;
} );
Notes
Only applies when WP_ENVIRONMENT_TYPE is local or development; production keeps WordPress's HTTPS requirement.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.