Search

How to Share a Draft Post with Anonymous Users

Not infrequently, I found myself in a situation where I wanted to share a post or page that was still in draft mode with someone who is not registered in the system.

For example, when someone wrote a guest post on the blog and I wanted to share the final version of the post before publishing, or for example, when I added a language to a specific site and before publishing, I wanted someone without access to the WordPress admin interface to review the translated page.

A quick search led me to the Public Post Preview plugin, which allows sharing a link with anonymous users so that they can view a preview of a draft, post, or any Custom Post Type (CPT) for review before it is published, and this is when they have no access to the WordPress management system.

How to Use the Public Post Preview Plugin

Using the Public Post Preview plugin is very simple:

  • Install and activate the plugin.
  • To enable sharing of a preview, simply check the checkbox under the “Preview” button in the post/page editor.
  • The link will be displayed to you; simply copy it and share it with whoever you want.
  • To disable the preview, simply uncheck the box.

Here’s how it looks in the classic WordPress editor:

Sharing a draft post with an anonymous user in the classic WordPress editor

And here’s how it looks in Gutenberg (WordPress 5.0+):

Sharing a draft post with an anonymous user in Gutenberg

The link will be available for only 48 hours, after which a new link is automatically generated. If you want the link to be active for more than 48 hours, you can use the following filter:

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

After adding this code, the links generated will be available for 5 days. Of course, you can increase this value in the code itself.

Roee Yossef
Roee Yossef

I develop websites & custom WordPress themes by design. I love typography, colors & everything between, and aim to provide high performance, seo optimized websites with a clean & semantic code.

0 Comments...

Leave a Comment

Up!
Blog