Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 738461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:50:20+00:00 2026-05-14T07:50:20+00:00

How can I let a user access a WordPress protected page with a URL

  • 0

How can I let a user access a WordPress protected page with a URL that will submit the password in the form below?

I want to be able to let a user get to a password protected WordPress page without needing to type the password, so when they go to the page, the password is submitted by a POST URL on page load.

This not intended to be secure in any respect; I’ll need to hardcode the password in the URL and the PHP. It’s just for simplicity for the user.

Edit 4/19/10: As per answers below, it’s possible to set a cookie directly to allow users to not have to enter a password. Letting search bots in is best done by detecting the user agent and redirecting, as bots aren’t going to deal with cookies.

This is the form (which is WordPress core code):

<form action="http://mydomain.com/wp-pass.php" method="post">

Password: <input name="post_password" type="password" size="20" />

<input type="submit" name="Submit" value="Submit" /></form>

This is wp-pass.php (which is WordPress core code):

<?php
require( dirname(__FILE__) . '/wp-load.php');

if ( get_magic_quotes_gpc() )
    $_POST['post_password'] = stripslashes($_POST['post_password']);

setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);

wp_safe_redirect(wp_get_referer());
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:50:21+00:00Added an answer on May 14, 2026 at 7:50 am

    Rather than keep appending in the previous answer, I’ll try to explain the problem a bit further here.

    The way WordPress passwording works, is:

    1. The original page has a form, which
      is sent to wp-pass.php.
    2. wp-pass.php takes the provided
      password, puts it in a cookie and
      redirects the user back ot the
      original page.
    3. The original page checks the cookie
      and if the password is correct, it
      will show the page.

    The problem here is that search engines don’t accept cookies. So, you have two options:

    1. Change the code WordPress uses for passworded content to something that also accepts $_GET variables.
    2. Use cURL to send the cookie using headers, having a separate page search engines can use.

    I’d love to expand on the latter answer if you want, but I do wonder; if you’re going to give search engines access to passworded content, anyone will have access. Why not just remove the password?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 532k
  • Answers 532k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Every JPA example and tutorial have main method to run… May 17, 2026 at 12:03 am
  • Editorial Team
    Editorial Team added an answer I suspect there's a byte-order-mark in your XML response. See… May 17, 2026 at 12:03 am
  • Editorial Team
    Editorial Team added an answer Set your validation range formula to =INDEX(items,0,1) Though is your… May 17, 2026 at 12:03 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Background I have a web app that will create an image from user input.
First off, let me define the end goal: I'd like to Wordpress (version 2.8)
In my rails app I'd like to let users submit custom themes to display
A desktop app (made in Delphi) is started by User A. Let's call it
let us assume that I have a reusable business layer that further makes use
I'm starting research on what I'd need in order to build a user-level plugin
I'm trying to use core data in a multi thread way. I simply want
As our company would never let a third party like github anywhere near our
I'm building a webapp with role based access control using Acegi (Spring) security. So
I need to revoke an authentication cookie if the user no longer exists (or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.