Public Post Preview (en)

Zur deutschen Beschreibung wechseln.

Public Post Preview Screenshot
Checkbox in the Publish Metabox

Have you ever been writing a post with the help of someone who does not have access to your blog and needed to give them the ability to preview it before publishing?

This plugin takes care of that by generating a URL with an expiring nonce that can be given out for public preview.

The plugin generates an URL with an expiring nonce. By default a link “lives” 48 hours. After 48 hours the link is expired and you need to copy and share a new link which is automatically generated on the same place under the editor.

48 hours are not enough to me. Can I extend the nonce time? Yes, of course. You can use the filter ppp_nonce_life.
Example for 5 days:

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

Thanks to Hans Dinkelberg for his photo.


The plugin has been downloaded 0 times.
It got 94% positive feedback, based on 65 ratings from the plugin repo on

The plugin requires WordPress 5.0 and is compatible up to WordPress 6.0.


2.9.3 (2021-03-12):

  • Compatibility with WordPress 5.7.
  • Create a fresh preview URL when enabling public preview.
  • Add check for possibly undefined PHP “superglobals”. Props @waviaei.

2.9.2 (2020-10-03):

  • Fix saving of preview status without a previous Ajax request.

2.9.1 (2020-07-25):

  • Improve HTTP status codes for expired/invalid preview links.

For more see

32 thoughts on “Public Post Preview (en)”

  1. I recently installed your Public Post Preview plugin but when I shared the link with someone there was a message that said “expired”. How do I make the link available for a longer period of time? What is the default time frame before it shows as expired? Looks like a great plug in if we can get it to work properly.
    Thank you,
    Halle Eavelyn

    1. By default the link is available for 24 hours. It based on the WordPress Nonces API and exists for security reasons.

      If a link (the nonce code) has been expired you can copy the link again.

      If you really want to extend the time to can use the filter in wp_nonce_tick().
      For example:

      add_filter( 'nonce_life', 'ds_nonce_life' );
      function ds_nonce_life( $seconds ) {
      	return 60 * 60 * 24 * 50; // 50 days
  2. I am running WordPress 3.4.1 and Public Post Preview 2.0.1. The preview links are not working. If I am still logged into my account they work, but if I am logged out (or for other non-registered users) there is a 404 Not Found error. Any ideas on what is going on or how I can fix it? Thanks.

  3. Since the update yesterday links are no longer working and I get “The link has been expired!” and the formatting of the website is broken on that page. This was working quite well before yesterday’s update.

  4. I would like to say that im glad that this plugin has been picked back up again and is being updated. One feature that I miss from previous verisons in the ability to right click the link and then click Send Link. Is it possible to reimplement this feature?

    1. That was not a feature of the plugin, more a feature of your browser. Since the link is now in a textbox the browser cannot provide this feature anymore.

      Currently there is no plan to restore it as a link. But maybe I can add a small linked icon after the textbox. The browser should detected this too.

    2. I went ahead and changed the code in the my installation to the following for lines 169-172

      <a href="ID ) ); ?>”>ID ) ); ?>

    3. Well that didn’t work. I just added the <a> tag around the link and placed the php for the link in the href.

  5. I just installed it and whilst it works, my post has a border around it. Looking at the source its a div titled error. I think WordPress notices that you’re trying to view a unpublished post and tries to put an error around it

  6. “After 48 hours the link is expired”

    This has to be the most bizarre, unhelpful, and annoying “default” behavior of any plug-in I’ve ever seen. Why not just remove that feature?

  7. i have installed the Public Post Preview and activated it. I do not see where the checkbox is to enable the actual link.

    I have screenshots of what I am experiencing if you send me an email address.


  8. Really great plugin – I’ve been relying on it for a couple years now, fantastic.

    Thanks Dominik!

  9. I understnad I can add the filter…sorry, but I am a real rookie. Is there somewhere imn particular in the edit box I add this?? I can see where the ppp_nonce_life is in the html…do I put it there. I really need to change it to several days.

    thanks-very helpful plug in for me.


  10. I there Dominik. 2 questions please:
    1. I’m not a dev and I have made some invalide researches on the web, including on WP Codex (, to add the filter ppp_nonce_life. Which file do I have to edit to add this filter if I don’t want to use the ‘Public Post Preview Configurator’ plugin?

    2. Do you think there is any chance to configure different expiration time for different links? For instance, one link will expire after 7 days and at the same time, another link will expire after 2 days. And so on..

    Thanks Dominik

  11. Hey, I’m using this plugin and I’m having some trouble with it:
    For some reason, if I add internal link to my post (which I intend to enable public review for), it’ll apply the public review to the internal link. Is it possible to leave the internal link as it is, instead of changing it?

  12. This is a great plugin, really handy for collaboration with multiple stakeholders. But can the preview link be available for a longer than 24 hours? It would be great to have the option of never having the link expire, or settting our own timeframe. Please & thank you.

    1. Sorry, just saw the ‘filter’ we can add. Where does it go?

  13. Does the link that was generated expire if we reopen that page before the person we sent the link to got a chance to view it? For example, I’ve sent some drafts to my boss, but before he got a chance to open it (and he opened it less than an hour after I sent the link), it says expired. I haven’t made any changes to the post, but I have closed and reopened it several times.

    Or is it incompatible with certain browsers because I’m not sure what he’s using, but it worked on Chrome for me, but not Safari? Are there changes to a browser’s settings that need to be made?

  14. Hi Dominik, great plugin! We are using it with the Avada Theme and the Fusion-Slider. Unfortunately the slider doesn’t show up in the preview. Do you have an idea why? Thank you for your help!

  15. Hi,

    I just updated to WP 5.7.

    However, I am getting the following error with PREVIEW:

    Deprecated: wp_no_robots is deprecated since version 5.7.0! Use wp_robots_no_robots() instead. in /home1…

    Any assistance is much appreciated!



  16. I like this plugin, and it’s the only one I’ve found that provides this functionality, but I keep getting “Not found” errors whenever the post is updated, the preview link just stops working. Is there any fix for this?
    Thanks in advance!

  17. Hi Dominik,

    Love your plugin, very useful. Just following up on extending the Nonce life for this plugin. Adding this code to the functions.php doesn’t seem to work.

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

    Just wondered if there was a fix to ensure extension of the nonce life that doesn’t involve installing a plugin to change a plugin.


Leave a Reply