Public Post Preview: Send WordPress posts in advance for viewing

WordPress Plugin Public Post Plugin for public preview

For me it happens every now and then that companies that have one book a sponsored postwant to read beforehand what I have written about your product or service. This can of course be solved by simply copying the text into an email and sending it to the customer. However, I don't find the solution so nice, because I put a lot of effort into photographs and screenshots and I want the customers to be able to see the entire article including all images.

The "Public Post Plugin" plugin enables you to share an article preview with other people.
The WordPress plugin "Public Post Plugin" allows you to share an article preview with other people.

Solution: Public Post Preview for WordPress

The programmer Dominik Schilling has a small but nice plugin for this purpose called Public Post Preview or in German "Public Preview for Articles" that allows giving access to the preview of an article via a specific URL for a limited time. The article can and should be saved as a draft so that it is not already publicly available.

If the plugin is activated in WordPress, the option to switch on the public preview appears in the publish box on the right.
If the plugin is activated in WordPress, the option to switch on the public preview appears in the publish box on the right.

To enable public preview, simply check “Enable public preview” in the publish box in the WordPress editor (see screenshot above). A small text field opens there (see screenshot below) with an Internet address that you can copy and then send to any person via email, WhatsApp or in some other way.

If you activate the public preview, the plugin creates a URL in the text field with which you can share the article preview with others.
If you activate the public preview, the plugin creates a URL in the text field with which you can share the article preview with others.

Preview articles are not indexed by Google

But be careful: Anyone who gets this URL can access the pre-release version of the blog post. The good news: WordPress tags every preview page with a robots meta tag that tells search engines not to index the page. This prevents such a URL from suddenly appearing in the Google search even though the post has not actually been approved yet.

Yoast SEO and Preview output different robot information

Who - like me - the SEO plugin Yoast SEO uses, who will be surprised when he looks at the source code of the preview article. Both WordPress and Yoast SEO each place a robots meta tag in the HTML - Yoast SEO with the value "index,follow" and WordPress itself with "noindex,follow". Of course, these are contradictory instructions for Google and other search engines, and it is difficult to tell what the bot will do when it reads such a URL.

I also haven't found a trick to tell Yoast SEO to always print "noindex" on preview blog posts. However, since the preview links are only valid for 48 hours and then a 404 error occurs (or a redirect to the published article), indexing is only temporary anyway.

In this line you can adjust the time that the public preview should be available.
In this line you can adjust the time that the public preview should be available.

Small hack: more time for the public post preview

At this point I would like to introduce you to a little hack that I made in the source code of the Public Post Preview plugin. The 48 hours that a preview link remains active is often set too short in practice. I often get the answer that the URL stopped working because it took three or four days for customers to take care of viewing the article.

To extend the time period to one week, open the plugin directory and then select the file "public-post-preview.php". In the text editor, look for this command at line 574 of the code:

$nonce_life = apply_filters( 'ppp_nonce_life', 60 * 60 * 48 ); // 48 hours

We change this line as follows:

$nonce_life = apply_filters( 'ppp_nonce_life', 60 * 60 * 24 * 7 ); // 1 week

The last number in the invoice now indicates the number of days that the preview URL should be valid. You just have to remember that this change will be overwritten every time the plugin is updated.

Of course, it would be great if there was a settings page for the plugin in the WordPress admin area, where you can set the time yourself, but unfortunately my programming knowledge is not enough. Maybe at some point Dominik will have the muse to incorporate this feature.

Did you like the article and did the instructions on the blog help you? Then I would be happy if you the blog via a Steady Membership would support.

2 Responses to “Public Post Preview: Send WordPress posts for preview”

  1. So there are sponsored posts here after all.
    That was my guess for a long time.
    Sir Apfelot has now been tipped out of my RSS reader.

    1. @Froyo52: You can calm down. If you had read the linked post, you would see that all posts that were sponsored have an addition of "Sponsor" in the title and in the meta tags for Google. Even if I am sent products to test, I point out that the companies make them available to me free of charge, but that does not mean that I mince my words when I have criticism of the product. I hope I find a little place in your reader with this again... ;-)

Post a comment

Your e-mail address will not be published. Required fields are marked with * marked

In the Sir Apfelot Blog you will find advice, instructions and reviews on Apple products such as the iPhone, iPad, Apple Watch, AirPods, iMac, Mac Pro, Mac Mini and Mac Studio.

Specials