PageAccessReleasetime by Sebi

Enables you to set a start- and end-time for the release of pages. Prevents unreleased pages from being displayed.


Enables you to set a start- and end-time for the release of pages. Prevents unreleased pages from being displayed.





PageAccessReleasetime can be installed like every other module in ProcessWire. Check the following guide for detailed information: How-To Install or Uninstall Modules

After that, you will find checkboxes for activating the releasetime-fields at the settings-tab of each page. You don't need to add the fields to your templates manually.

Check e.g. the checkbox "Activate Releasetime from?" and fill in a date in the future. The page will not be accessable for your users until the given date is reached.

If you have $config->pagefileSecure = true, the module will protect files of unreleased pages as well.

How it works

This module hooks into Page::viewable and Page::listable to prevent users to access unreleased pages:

public function hookPageViewable($event) {
	$page = $event->object;
	$viewable = $event->return;

		// If the page would be viewable, additionally check Releasetime and User-Permission
		$viewable = $this->canUserSee($page);
	$event->return = $viewable;

public function hookPageListable($event) {
	$page = $event->object;
	$listable = $event->return;

		// If the page would be listable, additionally check Releasetime and User-Permission
		$listable = $this->canUserSee($page);
	$event->return = $listable;

To prevent access to the files of unreleased pages, we hook into Page::isPublic and ProcessPageView::sendFile.

The site/assets/files/ directory of pages, which isPublic() returns false, will get a '-' as prefix. This indicates ProcessWire (with activated $config->pagefileSecure) to check the file's permissions via PHP before delivering it to the client.

public function hookPageIsPublic($e) {
	$page = $e->object;
	if($e->return && $this->isReleaseTimeSet($page)) {
		$e->return = false;

The check wether a not-public file should be accessable happens in ProcessPageView::sendFile. We throw an 404 Exception if the current user must not see the file.

public function hookProcessPageViewSendFile($e) {
	$page = $e->arguments[0];
	if(!$this->canUserSee($page)) {
		throw new Wire404Exception('File not found');

Additionally we hook into ProcessPageEdit::buildForm to add the PageAccessReleasetime fields to each page and move them to the settings tab.


In the current version, releasetime-protected pages will appear in wire('pages')->find() queries. If you want to display a list of pages, where pages could be releasetime-protected, you should double-check with $page->viewable() or $page->listable() (for lists) wether the page can be accessed. $page->viewable() returns false, if the page is not released yet.

To filter unreleased pages, add the PageAccessReleasetime::selector to your selector:

$onlyReleasedPages = wire('pages')->find(', ' . PageAccessReleasetime::selector);

If you have an idea how unreleased pages can be filtered out of ProcessWire selector queries, feel free to write an issue, comment or make a pull request!


We use SemVer for versioning. For the versions available, see the tags on this repository.


This project is licensed under the Mozilla Public License Version 2.0 - see the file for details.

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Latest news

  • ProcessWire Weekly #499
    In the 499th issue of ProcessWire Weekly we'll check out the latest weekly update from Ryan, introduce a new third party module called RockPdf, and more. Read on! / 3 December 2023
  • Using date range fields in ProcessWire
    This week we'll take a detailed look at the newest addition to the ProFields set of modules: the Date Range Fieldtype and Inputfield.
    Blog / 24 November 2023
  • Subscribe to weekly ProcessWire news

“…building with ProcessWire was a breeze, I really love all the flexibility the system provides. I can’t imagine using any other CMS in the future.” —Thomas Aull