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" enables 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 to German "Public preview for contributions" developed that allows access to the preview of an article for a limited time via a specific URL. 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 activate the public preview, simply put a checkmark next to "Activate public preview" in the publish box in the WordPress editor (see screenshot above). Now a small text field opens there (see screenshot below) with an Internet address that can be copied and then transmitted to any person via email, WhatsApp or otherwise.

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 text 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". These are of course contradicting instructions for Google and other search engines and it is difficult to say what the bot will do when it reads such a URL.

I haven't found a trick yet to tell Yoast SEO to always print "noindex" on preview blog posts. However, since the preview links are only valid for 48 hours anyway 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 to a 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 in 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.

-
 

 

Effectively for free: iPhone 13 Mini and iPhone 13 deals with top conditions at Otelo - Advertisement

2 comments

  1. Froyo52 says:

    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.

    • Sir Apfelot says:

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

Leave a Comment

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