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.
Chapter in this post:
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.
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.
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.
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.
Related Articles
Jens has been running the blog since 2012. He appears as Sir Apfelot for his readers and helps them with problems of a technical nature. In his free time he drives electric unicycles, takes photos (preferably with his iPhone, of course), climbs around in the Hessian mountains or hikes with the family. His articles deal with Apple products, news from the world of drones or solutions for current bugs.
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.
@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... ;-)