Content created in WordPress from the moment a post or page is added, but before it is published, receives draft status. You can send the draft to someone else, but that person must have adequate access to the wp-admin section. The problem arises when we want to show a draft of the post to people who do not have access to our wp-admin panel. For this purpose, we have created the Post Draft Preview plugin.
How it works
The plugin allows you to view a draft of an entry without logging into the administrator panel. In the post editing view, we have the option to generate a special link to the post.
After installing it, we can open our draft. If we use Gutenberg, then in the top bar of the editor we’ll see the button Enable PDP. This is shown in the picture below
After clicking the button, the generated public link to the draft will appear. Except that, there is also a button to Disable PDP for the current draft of the post.
The feature looks similar in the classic editor.
A random URL is generated for each post. This provides security because someone with only one draft link will not be able to view other drafts. Except that we can enable or disable the draft preview individually for each post.
All data is stored in the Post meta table, so even removing the plugin will not lose the generated links.
You can reset all generated draft links with one click. We can do it in Tools -> Post Draft Preview -> Reset link structure.
The option causes existing public links to drafts to stop working. However, this is necessary for security reasons.
An additional feature is the ability to delete all plug-in data. We can do it in Tools -> Post Draft Preview -> Remove all plugin data