How to Allow Public Post Preview of Unpublished Posts in WordPress

I’m always collaborating with someone, whether it be on this site or another. A lot of times I need to share drafts I have with others to get their opinions, comments, and correct any misinformation. WordPress by default doesn’t have a way to do this without first publishing the post. Thankfully though there is a quick and easy way.

Check out this tutorial below on how to allow public post preview for unpublished posts in WordPress.

How to Allow Public Post Preview in WordPress

Many of us bloggers and writers utilize both WordPress and Google Docs a lot. Anyone who does this on a regular basis knows that they don’t work great together. Sure there are tricks you can use, like this one on how to save images from Google Docs. But for the most part, when you’re writing something in WordPress you like to keep it in WordPress.

Thankfully there is a free nifty little plugin called Public Post Preview. It enables you to give a link to anonymous users for public preview of a post before it is published. I’ve used this for years and it has made my life a lot easier.

Public Post Preview WordPress plugin
Public Post Preview WordPress plugin

Public Post Preview is currently maintained by Dominik Schilling, who is actually a WordPress core developer. It currently has over 30,000 active installs with an impressive 5 out of 5-star rating. You can download it from the WordPress repository or by searching for it within your WordPress dashboard under “Add New” plugins.

There are no confusing settings or options with this plugin. After installing, simply open up a draft you have in WordPress. There will be an option on the right side to “Enable public preview.” This will generate a private URL that you can then share with your colleagues or whoever you are collaborating with. And don’t forget to save your draft if you haven’t already.

Enable public preview in WordPress
Enable public preview in WordPress

Tips on Using the Public Post Preview Plugin

There are a few additional things you should know about using this plugin:

  • Your post must be saved as a draft for the preview URL to work.
  • It works with posts, pages, and custom post types.
  • You can disable the preview URL by simply unchecking the box and resaving the draft or publishing it.
  • By default, the links expire after 48 hours. Users then see a “The link has been expired!” message.
Extend time on preview URL
Extend time on preview URL (Img src: Make a Meme)

In my case, nobody usually gets back to me in 48 hours. Don’t worry, you can easily extend the time with the following code. This allows for more correspondence time back and forth via email.

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

In the example above I configured mine to expire after 2 weeks (14 days). Simply add it to your theme’s functions.php file. Heck, you can set to three months if you want. Just modify the number above in the code.

You could also use a free plugin like Code Snippets to add the above code so as not to risk breaking anything on your WordPress site and without having to worry about your changes being overwritten with theme updates.

Extend public preview code
Extend public preview code

Summary

I’m always a huge fan of small and lightweight plugins that do one thing and do them well. This plugin saves me so many headaches from having to copy my posts temporarily somewhere else. I can work in WordPress, share in WordPress, and publish in WordPress.

Do you use this plugin? I would love to hear your thoughts below.

author bio
Brian Jackson

I craft actionable content and develop performance-driven WordPress plugins. Connect on X, subscribe to my newsletter (once a month), or buy me coffee.

5 thoughts on “How to Allow Public Post Preview of Unpublished Posts in WordPress”

  1. Hi Brian,

    That’s a smart little plugin which solves a big problem. And thanks for sharing tweak to extend the expiry time.

    Great share!

    Regards,

    Shafi Khan

    Reply
    • Totally agree! Nothing fancy here, but it is super handy for writers and bloggers. Google Docs and WordPress don’t mix well.

      Reply
  2. Hey Brian,
    I am just amazed. I didn’t know about this wonderful plugin.
    Thanks a lot..It’s definitely going to add value to my work and time.

    Thanks.

    Reply
    • Great, glad it was helpful! Yes many people I mention this to have never heard of it, so thought it would be worth a post :)

      Reply

Leave a Comment

3