How to Share WordPress Drafts in Public using Temporary URLs

How to Share WordPress Drafts in Public using Temporary URLs

There is a common problem with WordPress that you cannot share your blog post with any others when the content is not published online. If you send them the post link, they can only see a 404 error page. In this case, if you need others to have a look at your drafts for the review purpose, the only choice seems to give them a user account accessing your WordPress admin. But this may lead to the potential risks. So, how can you send others the unreleased contents with the best security? In this article, you can achieve this goal by checking how to share WordPress drafts in public using temporary URLs.

When to Share Your WordPress Drafts in Temporary Links

The web content that is not published online from your website can only be seen by you and users who have the permissions to check the drafts. Generally, users who are the Editor of your site have access to all the content drafts.

Now, it is possible that you want your friends or acquaintances to check some of these drafts for reviewing or approval. Only giving them the post permalink will redirect them to the 404 pages. In this case, you may decide to create the new accounts to the outside users for accessing your drafts. However, you should know that this may lead to the serious consequences even if you only allow the temporary login in WordPress.

It is true that your friends will not do anything harmful to your website deliberately. However, you should always view each dashboard access as the potential chance of attacks. Even, you cannot make sure that these people, especially the new WordPress users will not cause some errors on your site by messing up with WordPress features. In this case, you can generate a temporary link to some of your article drafts. And the methods to do so are listed in the following.

Method 1 – Public Post Review

The Public Post Review plugin gives you the freedom to link to any people for the public review or the real-time proofreading of your drafts. In this case, you can easily come out the blog posts with the help of outside authors who have no access to your website admin. This can perfectly increase the overall security of your site.

After installing this useful plugin, you can go to your draft directly. Here, you can find a new meta box in the Publish section of the editing screen. You simply need to click that checkbox. The plugin will generate a temporary link to your draft content automatically. You can send that link to other people for the content preview.

Public Post Review

Note that this link is available for 48 hours. Some of you may feel the validity period is too short and some of you may feel too long. Here, you can configure this value via two methods.

Edit the Plugin using FTP

If you are comfortable with editing your website file, you can access the plugin folder of /plugins/public-post-preview/ using the FTP client. Note that this folder can be found from public_html/wp-content/ folder.

From this plugin folder, you should target the public-post-preview.php file. Now, you can find the following string.

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

To adjust the validity, you simply need to change the value of these numbers, which refer to seconds, minutes and hours. For instance, if you want the link to be available in 45 minutes, you can replace the original string with the following one.

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

Install the Add-on Plugin

If you feel complicated to set up the plugin file, you can install the extra Public Post Preview Configuration plugin. By clicking the Settings > Public Post Preview Configurator button, you can decide the expiration hours easily.

Public Post Preview Configuration

Method 2 – Share a Draft

The Share a Draft plugin allows the same function as the first option. However, it is easier for deciding the expiration of the temporary link one by one. Here, you should click the Posts > Share a Draft button. From the dropdown list, you can choose a draft you are looking to send to others.

And in the below field, you need to decide the validity of the link in minutes, hours, days and weeks. Once decided, you can click the Share It button. And the link can be created at once. If you want to extend the expiration period, you should hit the Extend button on the Actions section to change the value.

Share a Draft