How to Share WordPress Post Drafts Using Temporary Links

Last Updated on December 31, 2022 by 19 Comments

Editorial Note: We may earn a commission when you visit links on our website.
How to Share WordPress Post Drafts Using Temporary Links
Blog / Tips & Tricks / How to Share WordPress Post Drafts Using Temporary Links

In most cases, giving people unrestricted access to your dashboard isnโ€™t a good idea. After all, the more people with administrator privileges, the greater the chance of a problem arising that could have serious consequences for your site.

One excellent way to limit the number of people with access to your dashboard is to use temporary links to share sensitive content. This means if you need to share WordPress post drafts, for example, you wonโ€™t have to provide users with an account to see them. In this article, weโ€™ll teach you how to do that, but first, letโ€™s talk a bit more about the dangers of unrestricted access.

Why You Should Restrict Access to Your WordPress Dashboard

The dashboard Users screen.

The more users with access to your dashboard, the greater the overall risk.

One of the easiest ways to improve security for any platform is to restrict access based on user roles. For example, not everyone needs an administrative account to do their jobs. Making sure the right roles are set is a primary element in keeping your website safe.

Default lower-level WordPress user roles are often quite restricted. Even so, you still donโ€™t want to give out dashboard access to everyone. As a rule of thumb, people shouldnโ€™t have their own accounts unless theyโ€™re regular contributors in one capacity or another, and hereโ€™s why:

  • More accounts equals increased risk.ย Think about each account with dashboard access as a potential entry point for attackers. It sounds a bit paranoid, but safety should always be a priority for website owners.
  • Users can cause errors on your website.ย Depending on their account privileges, people with dashboard access could break parts of your site by messing with features they donโ€™t understand.

The good news is there are ways to provide users with temporary access to specific parts of your site. For example, you can use temporary links to share WordPress post drafts with anyone you like. Letโ€™s talk about one tool to help you implement that feature.

An Introduction to the Public Post Preview Plugin

The Public Post Preview plugin.

The Public Post Preview plugin is a simple tool that solves a complex problem. It enables you to share your post drafts with anyone you want using a single link. This means if you want someone to check out (or even edit) one of your posts, you donโ€™t need to set up an account for them.

More importantly, every link the plugin generates is set to expire automatically after 48 hours. This means even if the link gets passed around, it will stop working after that period, and no one without an account will be able to touch it.

In practice, this feature can be helpful if you run a blog and occasionally want someone to look over your pieces before they go live. Plus, the code behind the plugin is theme independent, so it works with any website, including Divi blogs.

Key Features:

  • Create temporary access links for your WordPress post drafts.
  • Set your links to expire automatically, to prevent unauthorized access down the line.
  • Configure how long it takes for your links to expire if you need to.

Price:ย Free | More Information

How to Share WordPress Post Drafts Using Temporary Links (In 2 Steps)

Before you can start sharing, youโ€™ll (of course) need to install and activate the Public Post Preview plugin. Also, the optional second step will require you to access your WordPress files via File Transfer Protocol (FTP), and we recommendย FileZilla for this purpose.

Step #1: Choose the Post Youโ€™d Like to Share and Get Its Temporary Link

This part is straightforward. Simply select the post you want to share and open it using the WordPress editor. Once youโ€™re in, youโ€™ll see a newย Enable Public Previewย option in theย Publishย metabox:

Enabling public previews for your posts.

Once you click the checkbox, the temporary link will appear below:

Getting a temporary link to share your WordPress post drafts.

At this point, you can copy and send it to whoever you want to access your post drafts. Itโ€™s that easy!

As we mentioned, by default links will only work for 48 hours from the moment theyโ€™re created. However, if you want to change that time, check out the next section.

Step #2: Modify the Lifespan of Your Temporary Links (Optional)

The Public Post Preview plugin uses a type of security token called โ€˜noncesโ€™, both to enable access to your post draftsย and toย determine the lifespan of their links. If you want to change the length of that lifespan, you can do so by modifying the pluginsย ppp_nonce_lifeย function.

First off, access your website using FTP, then go to theย public_html/wp-content/plugins/public-post-previewย folder. Inside, youโ€™ll find a file calledย public-post-preview.php.ย By right-clicking it and using theย View/Editย option, itโ€™ll open using your default text editor:

Opening the file you need to tweak with a text editor.

Once youโ€™re in, use your editorโ€™s search function to locate the ย ppp_nonce_lifeย string. It should appear in the middle of the following code snippet:

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

This is the code we need to alter to change your linksโ€™ default lifespan. For example, if you want to set it to 72 hours instead of 48, just replace the third number in the sequence. This governs the number of hours the link will remain active for, so tweak it as needed. You can also limit access to mere minutes, as in the following exampleโ€ฆ

$nonce_life = apply_filters( 'ppp_nonce_life', 60 * 30 ); // 30 minutes

โ€ฆwhere the link will only โ€˜liveโ€™ for half an hour. However, thatโ€™s probably too restrictive, so we recommend setting it to a couple of hours at the very least. Do note that everything after theย //ย characters is whatโ€™s known as commentary, so it doesnโ€™t impact the lifespan of your links. Itโ€™s just there so you can take notes about the changes you make.

Once youโ€™ve settled on the new lifespan for your links, save your changes to theย public-post-preview.phpย file, close it, thenย carry out a quick test to make sure your link works.

Conclusion

Whenever possible, youโ€™ll want to limit the number of people who have unrestricted access to your dashboard. After all, not everyone needs an account, and in some cases you can provide temporary access to specific sections. That way, your website will be less vulnerable on the whole.

For example, if you want to share your WordPress post drafts, you can always use the Public Post Preview plugin. Hereโ€™s how:

  1. Choose a post and get a temporary link for it.
  2. If you want to, modify how long the link will remain active by editing theย public-post-preview.phpย file.

Do you have any questions about how to share WordPress post drafts using temporary links? Ask away in the comments section below!

Article thumbnail image by Booba22 / shutterstock.com.

Divi

Want To Build Better WordPress Websites? Start Here! ๐Ÿ‘‡

Take the first step towards a better website.

Get Started
Divi
Premade Layouts

Check Out These Related Posts

Splice Video Editor: An Overview and Review

Splice Video Editor: An Overview and Review

Updated on March 10, 2023 in Tips & Tricks

Video is a valuable form of content for social media. Unfortunately, creating quality videos is usually a long process that involves moving mobile footage to a desktop app for editing. However, mobile editing is on the rise. Apps such as Splice Video Editor make it possible to efficiently create...

View Full Post
How to Use Font Awesome On Your WordPress Website

How to Use Font Awesome On Your WordPress Website

Updated on September 16, 2022 in Tips & Tricks

When given the choice between using a vector icon or a static image, it’s a good idea to go with the vector. They’re small and fast to load, and they can scale to any size without a loss of resolution. Font Awesome is a superb library of vector icons that you can use on your websites,...

View Full Post

19 Comments

  1. Great article and review about the Public Post Preview. I can see that being of use to a number of users.

    • Thanks Roy! We’re glad you found this post useful. ๐Ÿ™‚

  2. Thanks John. I found this article to be quite helpful. Have been in this situation of wanting to share a draft before but you just came to my rescue.

    • You’re welcome, Walter! Thanks for commenting. ๐Ÿ™‚

  3. Very nice thankyo.

    • You’re welcome! ๐Ÿ™‚

  4. Magic!

    • Hi David! Thanks for reading. ๐Ÿ™‚

  5. Public post review is a great plugin which I am using it for my blog and also for my team collaboration. The thing I am looking for is an option where non-logged in users can vote or give their feedback which is not possible with this plugin. Is there any other where I can do it?

  6. A very educative write-up. The information about the plugin is very useful. Anyone can use such tips for their projects. Very helpful for the newbies.

    • Thanks, Ananya! We’re glad you found this post so useful. ๐Ÿ™‚

  7. John, very nice.
    Many thanks.

    • You’re welcome! Thanks for taking the time to read our post. ๐Ÿ™‚

  8. How handy! Thanks for sharing that plugin. ๐Ÿ™‚

    • Hi Carolyn! You’re welcome. ๐Ÿ™‚

  9. Son, I canโ€™t be more grateful because this is what I need just now?.

    Thanks a million!

    • You’re welcome, James! We’re glad you found this post so helpful. ๐Ÿ™‚

  10. Oh! Good find!

    This plugin seems useful!

    • Hi, thanks for your comment! ๐Ÿ™‚

Leave A Reply

Comments are reviewed and must adhere to our comments policy.

Get Started With Divi