James Clarke & Projects

Private URL WordPress Plugin

Private URL is a WordPress plugin for sharing private posts through a special private url which is accessible without requiring readers to register or enter a password. Private URLs have a structure similar to /private/293/df8eb1583b052b59e2cafc4327214d0/.

Installation

  1. Download the plugin from the WordPress Plugin Directory.
  2. Upload private-url.php to your wp-content/plugins directory.
  3. Activate the plugin through the Plugins menu in WordPress.
  4. Configure the plugin in the Private URL menu under Settings in WordPress.
  5. Create and save a private post. A new options panel called Private URL will show the private url for the post.

Private URL options panel

Usage

When you edit a private post a new options panel will become available called Private URL. This provides the private url and a means for changing the salt for the post. The url is a publicly accessible version of the private post and typically of the form: /private/293/df8eb1583b052b59e2cafc4327214d0/

What is the salt?

The salt is responsible to generating the private url for each post. It is similar to a passphrase. By default all posts use the salt provided in the settings page for Private URL. However, you can specify a post specific salt using the Private URL options panel while editing a post.

Modifying the salt for a post will cause it to have a new private url and the post’s old private url will no longer function. This can be used as a means to expire an old private url for the post. Changing the default salt in the options menu will cause all posts without their own salt to have new private urls.


15 Comments

Great script! Thanx!

 Sa?° on 21 January 2008

Hi I’d like to thank you for the plugin. But I had to switch to one called PrivatePost. I wanted to use yours but I couldn’t figure it out. I’m just a regular guy so extensive php codes or power user wordpress techniques just aren’t in my vocabulary. Again I’m a regular guy, so I can see how this plugin would be really nice for regular people who get a blog and maybe have one page that family or friends can see but not the public would be very helpful. But trying to figure out what to do with Private URL is just not clear enough for me. Do I write the post first and something shows up after I write, or is something accessible while I write to make the post become private when I’m done?

I like simplicity too, but a few hints would go a long way. All I’m saying is a step by step, or one or two screenshots could make this a little more accessible (for people like me who can figure how to install it but then hit a brick wall). But I sincerely appreciate the contribution to the wordpress evolvution.

 Dave on 7 March 2008

I committed 1.0.2 last night which fixes a bug with WordPress 2.5 and matches the new admin interface. I recommend using 1.0.1 for WP 2.3 still since the admin interface will match.

 James on 1 April 2008

I’ve installed the plugin but can’t do anything on it’s, blank. Any help on this plugin. Thanks for nice plugin share.

 onews on 7 April 2008

Blank mean I can’t configure or do setting to make your plugin run on my site. Need more detail step by step to make your script run, as others plugin which I’ve installed without any much problem to run it. Thank for your help.
http://img208.imageshack.us/img208/6522/wppluginlm7.gif

 onews on 7 April 2008

Have you installed it to the plugins directory? I works fine for me located both at /wp-content/plugins/private_url.php and /wp-content/plugins/private-url/private_url.php

On another wordpress install I just did:

$ wget http://downloads.wordpress.org/plugin/private-url.1.0.2.zip
$ unzip private-url.1.0.2.zip
Archive:  private-url.1.0.2.zip
private-url.1.0.2 packaged: Mon, 31 Mar 2008 22:22:04 +0000
  inflating: private-url/private_url.php
  inflating: private-url/readme.txt
$ rm private-url.1.0.2.zip


And everything worked fine.

 James on 7 April 2008

This plugin did not work for me because wordpress 2.5.1 doesn’t fill in the post->post_title var in the edit page to create the correct view URL.

I changed it to post_name which is filled out with (basically) the same information.

If you do a search/replace of “post_title” to “post_name” it works great!

 Rick Carback on 18 June 2008

Rick,

I cannot replicate your problem. I have tried both on this install and a fresh install and post->post_title is available in the edit page. It could be a plugin conflict and thus difficult to debug but it looks like you have found a fix that works.

I would be interested in hearing from anyone else who has the same problem then we might be able to determine the cause.

 James on 23 June 2008

Using WP v2.5 and plugin v1.0.2

I have installed the plugin and applied it to one of my private posts, but the URL provided by the plugin genereates a 404 (see image below).

http://laurenlesko.com/PrivateURL.png

Any suggestions?

 Kayte on 24 June 2008

Same here. 404 error if the author of the private post isn’t logged in.

 Sark on 25 June 2008

Kayte:

The URL generated on the edit post page does not work if you don’t have pretty permalinks enabled (Settings->Permalinks select anything but default). However you can manually construct a working URL. If the plugin says the URL should be:

/private/293/df8eb1583b052b59e2cafc4327214d0/

Another way of accessing the post is via:

/?p=293&prvpass=df8eb1583b052b59e2cafc4327214d0

I will see how difficult it is to update the plugin to automatically determine which URL to display. It shouldn’t be too hard once I find the right functions in the WordPress code.

Sark: I am not sure what your error is but does the above apply to you?

 James on 25 June 2008

James - that works perfectly, thank you so much!

One additional question - does this plugin disable/trump password-protection? When I set a password on a PrivateURL-protected posts and then follow the URL, it takes me straight to the post, no password necessary. Thoughts?

 Kayte on 27 June 2008

Kayte. The plugin bypasses the password. It seems a little strange to want a post to be both private and password protected, it may be possible to change the behaviour but surely passwording it is similar to making it private?

 James on 27 June 2008

I’m using custom permalinks and getting a 404 so I tried using the “?p=293&prvpass=” style link you suggested above (changing the post # of course) and I still get a 404. It works when I’m logged in, but that defeats the purpose. Thanks.

 M on 12 August 2008

I’ve added an alternative version (1.0.2.alt) of the plugin which uses post_name instead of post_title. Try this version out if you are having problems with 1.0.2.

 James on 13 August 2008

Leave a Comment