Post Expirator: Automatically Unpublish WordPress Posts


The Post Expirator plugin allows you to add an expiration date to posts. When your post is automatically unpublished, you can delete the post, change the status, or update the post categories.

There are a number of different ways that the posts can expire:

  • 下書き
  • 削除
  • ゴミ箱
  • Private
  • Stick
  • Unstick
  • カテゴリー:置き換え
  • カテゴリー:追加
  • カテゴリー:削除

For each expiration event, a custom cron job will be schedule which will help reduce server overhead for busy sites.

The expiration date can be displayed within the actual post by using the [postexpirator] tag. The format attribute will override the plugin
default display format. See the PHP Date Function for valid date/time format options.

NOTE: This plugin REQUIRES that WP-CRON is setup and functional on your webhost. Some hosts do not support this, so please check and confirm if you run into issues using the plugin.

[postexpirator] ショートコード属性

  • タイプ – デフォルトは すべて表示 – 有効なオプションはすべて表示、日付、時刻です
  • dateformat – 引数で設定された書式は、設定ページの値を上書きします。
  • timeformat – format set here will override the value set on the settings page



  • 投稿に有効期限を追加
  • Viewing the expiration dates on the post overview screen
  • 設定画面



  1. プラグインの内容を/wp-content/plugins/post-expirator/ディレクトリに解凍します。
  2. WordPress の「プラグイン」メニューからプラグインを有効化してください


plugin that works very well. easy to use and very efficient. thank you so much
This is a great plugin for us. We have several authors, lots of categories, and many posts which are time-limited. It keeps everything current and moves it to alternative categories or deletes it as time goes on. Excellent support after reporting a minor glitch: Workaround found immediately and problem fixed in a few days. Highly recommended.
An addition I would be grateful for is: Setting a default time per posts (in the defaults) For the rest awesome! Working perfectly.


Post Expirator: Automatically Unpublish WordPress Posts はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。


“Post Expirator: Automatically Unpublish WordPress Posts” は13ロケールに翻訳されています。 翻訳者のみなさん、翻訳へのご協力ありがとうございます。

“Post Expirator: Automatically Unpublish WordPress Posts” をあなたの言語に翻訳しましょう。

開発に興味がありますか ?

コードを閲覧するか、SVN リポジトリをチェックするか、開発ログRSS で購読してみてください。


[2.4.4] – 22 Jul 2021

  • Fixed: Fix conflict with the plugin WCFM, #60;
  • Fixed: Fix the Category: Remove option, #61;

[2.4.3] – 07 Jul 2021

  • Added: Expose wrappers for legacy functions, #40;
  • Added: Support for quotes in Default expiry, #43;
  • Fixed: Default expiry duration is broken for future years, #39;
  • Fixed: Translation bug, #5;
  • Fixed: Post expiring one year early, #24;
  • Changed: Bulk and Quick Edit boxes default to current date/year, #46;


  • Fixed: Bulk edit does not change scheduled event bug, #29;
  • Fixed: Date not being translated in shortcode, #16;
  • Fixed: Bulk Edit doesn’t work, #4;


  • Fix: Updated deprecated .live jQuery reference.


  • 修正: PHP 7でのPHP エラーを修正


  • 修正:一部のインストールで発生するPHPエラーを修正しました。


  • New: Email notification upon post expiration. A global email can be set, blog admins can be selected and/or specific users based on post type can be notified.
  • New: Expiration Option Added – Stick/Unstick post is now available.
  • New: Expiration Option Added – Trash post is now available.
  • New: Added custom actions that can be hooked into when expiration events are scheduled / unscheduled.
  • Fix: Minor HTML Code Issues


  • Fix: Quick Edit did not retain the expire type setting, and defaulted back to “Draft”. This has been resolved.


  • Fix: Fixed issue with bulk edit not correctly updating the expiration date.


  • New:クイック編集 – 有効期限の設定と有効期限後のステータスの切り替えをクイック編集で実行できるようになりました。
  • 新機能:一括編集 – 既に設定されている投稿の有効期限の変更を一括編集で実行できるようになりました。
  • New: Added ability to order by Expiration Date in dashboard.
  • New:デフォルトページのフォーマットを調整しました。 複数の投稿タイプが明確に表示されるようになりました。
  • Fix: Minor Code Cleanup


  • Fix: PHP Strict errors with 5.4+
  • Fix: Removed temporary timezone conversion – now using core functions again


  • Fix: Default category selection now saves correctly on default settings screen


  • Security: Added form nonce for protect against possible CSRF
  • Security: Fixed XSS issue on settings pages
  • New: Added check to show if WP_CRON is enabled on diagnostics page
  • Fix: Minor Code Cleanup


  • New: Added the option to disable post expirator for certain post types if desired
  • Fix: Fixed php warning issue cause when post type defaults are not set


  • New: Added support for hierarchical custom taxonomy
  • New: Enhanced custom post type support
  • Fix: Updated debug function to be friendly for scripted calls
  • Fix: Change to only show public custom post types on defaults screen
  • Fix: Removed category expiration options for ‘pages’, which is currently unsupported
  • Fix: Some date calls were getting “double” converted for the timezone pending how other plugins handled date – this issue should now be resolved


  • Removes old scheduled hook – this was not done completely in the 2.0.0 upgrade
  • Old option cleanup


This is a major update of the core functions of this plugin. All current plugins and settings should be upgraded to the new formats and work as expected. Any posts currently schedule to be expirated in the future will be automatically upgraded to the new format.

  • New: Improved debug calls and logging
  • New: Added the ability to expire to a “private” post
  • New: Added the ability to expire by adding or removing categories. The old way of doing things is now known as replacing categories
  • New: Revamped the expiration process – the plugin no longer runs on an minute, hourly, or other schedule. Each expiration event schedules a unique event to run, conserving system resources and making things more efficient
  • New: The type of expiration event can be selected for each post, directly from the post editing screen
  • New: Ability to set defaults for each post type (including custom posts)
  • New: Renamed expiration-date meta value to _expiration-date
  • New: Revamped timezone handling to be more correct with WordPress standards and fix conflicts with other plugins
  • New: ‘Expires’ column on post display table now uses the default date/time formats set for the blog
  • Fix: Removed kses filter calls when then schedule task runs that was causing code entered as unfiltered_html to be removed
  • Fix: Updated some calls of date to now use date_i18n
  • Fix: Most (if not all) php error/warnings should be addressed
  • Fix: Updated wpdb calls in the debug class to use wpdb_prepare correctly
  • Fix: Changed menu capability option from “edit_plugin” to “manage_options”


  • Added the ability to configure the post expirator to be enabled by default for all new posts
  • Changed some instances of mktime to time
  • Fixed missing global call for MS installs


  • Tweaked error messages, removed clicks for reset cron event
  • Switched cron schedule functions to use “current_time(‘timestamp’)”
  • Cleaned up default values code
  • Added option to allow user to select any cron schedule (minute, hourly, twicedaily, daily) – including other defined schedules
  • Added option to set default expiration duration – options are none, custom, or publish time
  • Code cleanup – php notice


  • Fixed invalid html
  • Fixed i18n issues with dates
  • Fixed problem when using “Network Activate” – reworked plugin activation process
  • Replaced “Upgrade” tab with new “Diagnostics” tab
  • Reworked expire logic to limit the number of sql queries needed
  • Added debugging
  • Various code cleanup


  • Cleaned up deprecated function calls


  • Fixed bug with sql expiration query (props to Robert & John)


  • Fixed bug with shortcode that was displaying the expiration date in the incorrect timezone
  • Fixed typo on settings page with incorrect shortcode name


  • Fixed bug that was not allow custom post types to work


  • Moved Expirator Box to Sidebar and cleaned up meta code
  • Added ability to expire post to category


  • Fixed issue with 3.0 multisite detection


  • Added post expirator POT to /languages folder
  • Fixed issue with plugin admin navigation
  • Fixed timezone issue on plugin options screen


  • Added support for custom post types (Thanks Thierry)
  • Added i18n support (Thanks Thierry)
  • Fixed issue where expiration date was not shown in the correct timezone in the footer
  • Fixed issue where on some systems the expiration did not happen when scheduled


注:アップグレード後、CRONスケジュールをリセットする必要がある場合があります。 通知が表示されたら、画面上の通知に従います。 以前にスケジュールされた投稿は更新されず、古いタイムゾーン設定を参照して削除されます。 それらを更新したい場合は、有効期限を手動で更新する必要があります。

  • Fixed compatability issues with WordPress – plugin was originally coded for WPMU – should now work on both
  • Added ability to schedule post expiration by minute
  • Fixed timezone – now uses the same timezone as configured by the blog


  • Fixed sporadic issue of expired posts not being removed


  • Expiration date is now retained across all post status changes
  • Modified date/time format options for shortcode postexpirator tag
  • Added the ability to add text automatically to the post footer if expiration date is set


  • Fixed issue with display date format not being recognized after upgrade


  • Changed wording from “Expiration Date” to “Post Expirator” and moved the configuration options to the “Settings” tab.
  • 投稿内に有効期限を表示するためのショートコードタグ[postexpirator]を追加
  • Fixed bug where expiration date was removed when a post was auto saved


  • 期限切れの投稿は、有効期限を保存します


  • 最初のリリース