Title: Pass password via querystring parameter
Last modified: August 21, 2016

---

# Pass password via querystring parameter

 *  Resolved [wesbeyrent](https://wordpress.org/support/users/wesbeyrent/)
 * (@wesbeyrent)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/pass-password-via-querystring-parameter/)
 * I’d like to be able to prepopulate the password input field via a querystring
   parameter, so that I can provide a link to my website that includes the password.
 * Alternatively, if I can bypass the password page by providing the password in
   a URL, what would be the best way to accomplish this?
 * I understand the security concerns by implementing this, but securing my site
   is not _that_ important to begin with.
 * Thanks!
 * [http://wordpress.org/extend/plugins/password-protected/](http://wordpress.org/extend/plugins/password-protected/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Ben Huson](https://wordpress.org/support/users/husobj/)
 * (@husobj)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/pass-password-via-querystring-parameter/#post-3931663)
 * I don;t intend to build that into the plugin by default, but using the existing
   hooks in the plugin it should be possible to bypass it by adding code to your
   functions.php file.
 * I’ve not tried this, but something like this might work:
 *     ```
       function my_option_password_protected_status( $option ) {
       	global $Password_Protected;
   
       	//If the URl contains the query "?bypass=true"
       	if ( isset( $_GET['bypass'] ) && $_GET['bypass'] == 'true' ) {
       		// Set the cookie to say we're logged in
       		$Password_Protected->set_auth_cookie();
       		return false;
       	}
       	return $option;
       }
       add_filter( 'option_password_protected_status', 'my_option_password_protected_status' );
       ```
   
 *  Thread Starter [wesbeyrent](https://wordpress.org/support/users/wesbeyrent/)
 * (@wesbeyrent)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/pass-password-via-querystring-parameter/#post-3931672)
 * Thank you, Ben. It works perfectly.
 * I will work on adding the ability to simply prepopulate the password textfield
   with a query string parameter and post back to this thread if I have any issues.
 * If I can get that working, I’ll consider my question 100% resolved.
 * Thanks again!
 *  [Ben Huson](https://wordpress.org/support/users/husobj/)
 * (@husobj)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/pass-password-via-querystring-parameter/#post-3931710)
 * There’s no hook to do it with PHP at present so you’d have to add it via JavaScript.
 *  Thread Starter [wesbeyrent](https://wordpress.org/support/users/wesbeyrent/)
 * (@wesbeyrent)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/pass-password-via-querystring-parameter/#post-3931752)
 * That’s what I thought. Thanks for the bypass help!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Pass password via querystring parameter’ is closed to new replies.

 * ![](https://ps.w.org/password-protected/assets/icon-128x128.gif?rev=2824217)
 * [Password Protected — Lock Entire Site, Pages, Posts, Categories, and Partial Content](https://wordpress.org/plugins/password-protected/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/password-protected/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/password-protected/)
 * [Active Topics](https://wordpress.org/support/plugin/password-protected/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/password-protected/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/password-protected/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [wesbeyrent](https://wordpress.org/support/users/wesbeyrent/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/pass-password-via-querystring-parameter/#post-3931752)
 * Status: resolved