Tutorial: Allow Public Preview of a Post in WordPress

public post previewPreviewing your own WordPress post is an essential part of any editing process.  You need to see how it looks, whether the formatting is correct, and  that it all makes sense.  Unfortunately, the WordPress core installation requires that you log in to see the post preview.

However, what happens when you want a third-party to check over your post before it is published?  Perhaps you need a specialist opinion, or want someone to give you a review, or check the grammar or spelling.  The old way was to create a user for them to log in, allowing them to preview the post after which deleting the user account again.  This is an unnecessarily complicated process, that thanks to some hard work by a developer called Dominik Schilling we are now able to access a Preview post in WordPress Publicly.

Public Post Preview Plugin

Dominik Schilling put his mind to the problem, and created a plugin called “Public Post Preview”, which is freely available at the WordPress repository.  At the date of posting, the plugin has had a total of 20,578 views, is rated 4.8 out of 5 stars.


What the plugin does is enable, with the simple tick of a box, for a link to be created that you can easily share to enable the public to freely preview the unpublished post.  With the link, no-one needs to log into WordPress or do anything else.  It is that simple.

The plugin works by using NONCE.  You may be asking “What is a Nonce?”.  Well, it stands for “Number used once” and allows specific URL’s be tied to a specific request.  In this case, it allows the post preview to be generated.  You can read more about NONCE on the WordPress.org site here.

Installing the Plugin

public-post-previewJust install the plugin via the admin interface, as you would with any other plugin.  You can either upload the plugin you downloaded via the WordPress Repository, or simple search for “Public Post Preview” and it will show as the top entry ready for you to click “install”.

Once installed, there is nothing further to do.  To create the shareable public preview URL, simple click the “Enable public preview” button in the right sidebar under the Publish section.

You can then copy and share the link that shows under the “Enable public preview” tick option.  If you decide you no longer wish for the public preview to be accessible you can just deselect it.

You should be aware that the link will only be valid for 48 hours.  If you need the public preview to extend beyond this period you will need to re-copy the URL which will automatically update itself, although there are a couple of ways you can change the expiry date.

How to Change the Default 48 hour Expiry Date for Shareable Links

There are two ways of doing this:

1.  Custom changes to the functions.php file

The following snippet of code will extend the NONCE time, which in the example below sets it for 5 days.  You can replace “5” with the required number of days.

add_filter( 'ppp_nonce_life', 'my_nonce_life' );
function my_nonce_life() {
    return 60 * 60 * 24 * 5; // 5 days

2. Public Post Preview Configurator Plugin

Someone took away all the hard work, and incorporated the code into a plugin with a simple interface that allows you to choose the number of hours you wish to the Public Post Preview link to be active.  Simply install this plugin  as you would any other plugin, and configure it by going to “SETTINGS -> Public Post Preview Configurator”.  A screen shot of the configuration screen is below:


As you can see it makes everything extremely simple.

Watch our Video Tutorial

Allow a Public Preview of your WordPress post

With the Public Post Preview Plugin you can allow the public to view your post before it is published.

Final Thoughts

This is a plugin that we have used on many occasions to get feedback from third companies on reviews or other tutorials.  It makes the process extremely simple, without having to create cumbersome instructions to enable people to log into your WordPress admin area just to preview one post.  However, there are some potential interesting uses for this functionality, such as early access to special members or a page with special offers that are only intended to be active for a short time.  Whilst we haven’t used it for anything like that, the use case is there.

  1. Reply Rachel October 6, 2014 at 2:16 pm

    This is extremely helpful – thanks for the plugin! 🙂

  2. Reply Anna May 31, 2014 at 10:20 pm

    I have found this very useful. Just one question though, is there any way someone can get hold of the URL without it explicitly begin given to them. I mean, are there any risks involved here? All I want to do is let one of my friends view posts from time to time before they are published.

  3. Reply Jonathan May 31, 2014 at 3:44 pm

    I’ve just added a quick walk through video tutorial, which demonstrates the Public Post Preview Plugin in action.

  4. Reply Mark May 30, 2014 at 4:37 pm

    Excellent. Being able to show people the post before it is published is going to help a great deal. Usually, I would just post it, and then make amendments after as I never wanted to give out user access just for them to view it.

Leave a reply