How can I transfer a Password via URL-Parameter to a password protected Page

[ad_1]

Hello,
I have a WordPress blog and have a password-protected page there. For example, let's call it https://mywordpressblog.net/downloads/) and the password "password123". I would now also like to enter the password via URL. I imagine that the URL would look like this: https://mywordpressblog.net/downloads/?post_password=password123. However, the form field for the password, which according to the HTML view of the page is called post_password, remains unaffected. Where is my mistake and how can my problem be solved? I would be very happy if someone could help me.

Thank you,
Dragonwolf

[ad_2]
3 Comments
  1. I believe browsers don’t pass form parameters whose type is password, and even if they did, it’s really not a secure thing to do. Any reason you want to do it this way?

  2. Do you mean you want to pre-populate the password field on your /downloads/ page with whatever is in that URL variable? If so you’d do something like:

    <input value=”<?php echo $_GET[‘post_password’]; ?>” />

  3. This is gated content, there are quite a few plugins, free and commercial that will do the job, but possibly not exactly as you plan. I’d recommend having a look at a few and see if there’s a workflow that works for you. 

    How are you planning on selling the music/booklet? WooCommerce? 

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer