How to Create Public Preview Link For Unpublish Post In WordPress?

Affiliate disclaimer: We may earn an affiliate commission if you purchase via links on our site. Learn more.

Share this article

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest

Logged-in users can only view public preview links for unpublished posts in WordPress. Therefore, creating a preview link for an unpublished post, page, or custom post can be more challenging because there are no clear instructions on how to do so.

The lack of clarity means that many WordPress users cannot easily create preview links and share them with others before publishing.

However, having no this option is the default behavior of WordPress. So, when you need to send a link to a public preview of unpublished posts via email, what do you do?

The simple answer is that you cannot create it without a configure. So how can you run this feature & get this benefit from WordPress?

Here is a simple guide that will help you to get an unpublish preview link of your draft post. Are you wondering how? Follow the complete steps, and you will have a clear idea about how it works.

strange look

Why do you need the unpublished post preview link?

There might be different reasons for you to generate a unpublish preview link in WordPress.

  • You need a public preview of a post you have unpublished and sent for review.
  • If you’re involved in SEO work, you might need a public preview of the post that search engines haven’t yet indexed.
  • It is helpful for a writing agency that provides monthly content writing and publication services for clients’ websites.
  • If you are doing affiliate marketing, you might need links to products that are not published on your site, as well as images of the products.

Whatever may be the reason, getting an unpublished post preview link is very helpful for various reasons. Make sure you generate it whenever possible.

Guide to Create Unpublish Post Preview Link

To enable an option for creating a public preview link for a post, you need to install and activate a plugin on your site called Public Post Preview. Using a plugin for this feature is the most suitable option because it can be activated or deactivated with a simple click.

You can also create unlimited preview links for your DRAF post or page using the mentioned plugin and send them to anonymous users for public preview.

Let’s start.

First, you need to install and activate the plugin (Public Post Preview). Next, open your draft post.

install public post review plugin

Now, look in the right sidebar of the post editor for a feature called ‘Enable public preview‘ just under ‘Publish immediately.’

Next, to create a preview link, enable the check box. A public preview link automatically will appear under the check box. Done!

Enable public preview

Now you can share this preview link with anyone to let them see your unpublished content.

Now the question is how to disable the preview link after 1st creation? The answer is straightforward. Just uncheck the ‘Enable public preview.‘ You are done.

Note- Please note that this preview link will not work after 48 hours by default. You need to add a code snippet to your theme’s functions.php file to extend its expiration date.

Is there a code snippet I should use? Okay, here’s a simple code snippet you can use. Simply copy and paste the below code into your theme’s functions.php file.

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

If you want to increase the number of expired days beyond 7, you can replace the day count.

Remember that using code directly in functions.php is not a safe practice. Before you implement it, you should back up both your file and database. Try to use child themes for theme customization or to add any custom code to your theme files.

If you don’t know how to create a child theme, you can follow my guide to create a child theme using the most straightforward way.

Lastly, if you do not want to create a child theme, you can use the code snippet plugin to add codes to any of your theme files.

Note- It is a wise practice for beginners to add a child theme or code snippet plugin. However, if you know little about WordPress or coding, you can easily do it.

In Conclusion

Hopefully, you will get the right guide on creating a public preview link for unpublished posts in WordPress?’ The above plugin is more lightweight and easy to use. This plugin is definitely for you if you struggle with creating preview links for unpublished posts in WordPress.

So what are you waiting for? Just get started.

Don’t forget to share your experience in the comment section below. Thanks!

Share this with your friends & colleagues.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest
Palash

Palash

Palash Talukdar is a digital marketer & the founder of WP Basic Pro. He has been building and managing WordPress websites for 5+ years. He loves to write about WordPress, SEO, marketing, productivity, and web performance.

Last Updated Deals

OUR SPONSORS

Divi 25% OFF

Quick Contents

20% OFF
Click to Reveal
Perfmatters Review

Perfmatters Coupon (20% OFF)

Perfmatters is one of the best lightweight WordPress performance plugins.
View this Deal