Public Post Preview




之前這個外掛由 Jonathan Dingman 發想,並由 Matt Martz 開發維護,同時也感謝 Hans Dinkelberg 所提供的照片


  • 在內容編輯頁的 [發佈] 功能區中,核取 [啟用公開預覽] 便能啟用這項功能。
  • 功能啟用後,內容預覽網址便會出現於設定下方,複製這個網址並分享給有需要的人。
  • 取消核取 [啟用公開預覽] 便能在該篇內容中停用這項功能。


  • 在區塊編輯器中的外掛設定
  • 在傳統編輯器中的外掛設定



透過 WordPress 自動安裝:

  1. 前往 WordPress 管理後台的 [安裝外掛] 頁面。
  2. 搜尋「Public Post Preview」。
  3. 點擊 [立即安裝] 並啟用這個外掛。

透過 FTP 手動安裝:

  1. 上傳解壓縮後的 public-post-preview 目錄及目錄中的檔案至網站主機的 /wp-content/plugins/ 目錄中。
  2. 在 WordPress 管理後台的 [外掛] 頁面中啟用這個外掛。

透過 WordPress 上傳外掛,而不是透過 FTP 上傳:

  1. 在本頁右上方點擊 [下載],然後在 WordPress 管理後台的 [安裝外掛] 頁面中上傳已下載至本機的 ZIP 檔案並完成啟用。



這項設定僅出現於尚未發佈的內容,以及將 [狀態] 變更為 [草稿] 的內容。

為什麼在過了一段時間後,透過預覽連結檢視內容會顯示 [這條連結已過期失效!]?

這個外掛所產生的內容預覽網址有其時限,網址使用時限預設為 48 小時。48 小時過後,預覽連結便會過期,內容作者必須在內容編輯頁面中複製外掛所產生的新網址,並分享給有這項需要的使用者。

預覽連結預設 48 小時的使用期限對某些人來說不太夠,是否有辦法變更這項預設設定?

當然可以,使用 ppp_nonce_life 篩選器便可設定連結有效期限。以下範例程式碼能將預覽期限延長至 5 天:

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

或是安裝並啟用 Public Post Preview Configurator 外掛,也能變更這項設定。


六月 25, 2019
I was trying to find a way to Share a Draft, but only found pointers to a dead plugin. I am not sure how I stumbled on this one but would like to suggest that you include the phrase "share a draft" somewhere in your description.
四月 10, 2019
Does its job and is tunable by hooks. Moreovere, since the main class is made by static methods I had the opportunity of deregister hooks for my needs.
二月 22, 2019
Please resolve this issue. This plugin is not working with Classic Editor ( in wordpress 5.0.3 Version.
六月 4, 2018
Have used this several times to show clients a preview of updates. It has always worked well for us! Thanks for a nice plugin!
閱讀全部 48 則使用者評論


Public Post Preview 外掛為開源軟體。以下人員為這個外掛做出了重大貢獻。


Public Post Preview 外掛目前已有 16 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將 Public Post Preview 外掛本地化為台灣繁體中文版


任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄


2.8.0 (2018-11-27):

  • Add support for WordPress 5.0 and the new block editor.

2.7.0 (2018-09-14):

  • Initial support for Gutenberg.
  • Block robots for public post previews. Props @westonruter.

2.6.0 (2017-04-27):

  • Make DS_Public_Post_Preview::get_preview_link() public. Props @rcstr.
  • Send no-cache headers for public post previews.

2.5.0 (2016-04-05):

  • Auto select preview link on focus. Props @JeroenSormani.
  • Remove preview status from posts which are trashed or after scheduled posts are published.
  • Add support for paged posts.

2.4.1 (2015-10-13):

  • Update text domain to support language packs. Translations are now managed via

2.4 (2014-08-21):

  • Supports EditFlow and custom statuses
  • Disables comments and pings during public post preview
  • Adds Public Preview to the list of display states used in the Posts list table
  • Prevents flickering of link box on Post edit while loading

2.3 (2013-11-18):

  • Introduces a filter ppp_preview_link. With the filter you can adjust the preview link.
  • If a post has gone live, redirect to it’s proper permalink.
  • Adds the query var _ppp to WordPress SEO by Yoast whitelist.

2.2 (2013-03-15):

  • Based on feedback I have removed the extra metabox and added the preview link to the main Publish metabox.
  • Only show the checkbox if the post status/post type is good.
  • Requires WordPress 3.5.

2.1.1 (2012-09-19):

  • Sorry for the new update. Through a change in 2.1 a filter was applied to each query. The misplaced “The link has been expired!” message is now gone. Props Aki Björklund and Jonathan Channon.

2.1 (2012-09-16):

  • Introduces a filter ppp_nonce_life. With the filter you can adjust the expiration of a link. By default a link has a lifetime of 48 hours.
  • In some situations (still not sure when) the preview link is rewritten as a permalink which results in an error. The plugin now works in this situations too.

2.0.1 (2012-07-25):

  • Makes the preview link copyable again

2.0 (2012-07-23):

  • Support for all public post types
  • Saves public preview status via an AJAX request
  • I18n
  • Requires at least WordPress 3.3

1.3 (2009-06-30):

  • Hook in earlier in the post selection process to fix PHP notices
  • Add uninstall functionality to remove options from the options table

1.2 (2009-03-30):

  • Fix preview URL for scheduled posts on sites with a permalink other than default activated.

1.1 (2009-03-11):

  • Don’t limit public previews to posts in draft or pending status. Just exclude posts in publish status.

1.0 (2009-02-20):

  • Initial Public Release