PJ Maintenance

By PureJeannius

0+ active installationsVersion 1.0.0

Hide your site behind a maintenance, coming-soon or site-closed page with your logo, text, buttons and background. Export it as a static page.

Description

PJ Maintenance puts your whole site behind one page. Turn it on, and visitors see your maintenance, coming-soon or site-closed page; you and anyone you choose keep seeing the real site.

Three modes

  • Maintenance sends HTTP 503 with a Retry-After header, so search engines know the site is down for a short time and keep your rankings.
  • Coming soon sends a normal page (HTTP 200), with an option to ask search engines not to index it.
  • Site closed / moved is for a site that is gone for good. The home page stays a normal page search engines can find; every other old address shows the same page with HTTP 410 (Gone), so old links still land somewhere useful while search engines drop them.

Build the page without code

  • Logo (from the Media Library) with an adjustable width
  • Heading and subheading
  • Content with the WordPress editor — text and formatting (headings, bold, italics, lists, quotes, alignment); links go on the Buttons tab
  • Footer line for copyright, address or email
  • Background color, or a background image with fit, focus point and a color overlay so text stays readable
  • Text and accent colors, system sans-serif or serif font, centered or left-aligned, plain or on a card

Buttons

Send visitors where they need to go: add buttons with a label, a link (web address, email or phone) and an optional description. Show them as buttons in your accent color — with your own title, description and hover colors — or as cards, one to four per row. Drag to reorder.

Export as HTML

Download the page as a zip of plain files — index.html, its images, and an .htaccess that answers with the same status codes — so it can stay online after WordPress is removed. Handy when a site closes for good.

Access for the right people

  • Administrators always see the real site.
  • Choose other roles (Editor, Author…) that skip the page when logged in.
  • Turn on a private access link for clients or testers who don’t have an account. The link sets a cookie for 30 days, and you can replace it any time.

Built to behave

  • Quick on/off switch and preview in the admin bar, with a red indicator while the page is up.
  • Optional login padlock in the corner of the page: it slides in a login panel (no JavaScript); after logging in you stay on the website, or go to the dashboard if you prefer.
  • Keeps posts, pages, users and media out of the REST API (and feeds) while the page is up (you can switch the REST part off on the General tab); other plugins’ public REST routes, such as galleries and carts, keep working, and so do the login page, admin and robots.txt.
  • The page is never cached, and turning the page on or off clears WP Fastest Cache, W3 Total Cache, WP Super Cache, WP Rocket and LiteSpeed Cache.
  • Lightweight: one small stylesheet, loaded only on the maintenance page. No JavaScript, theme files or tracking.
  • Translation ready.

Add-ons

PJ Maintenance Pro is a separate plugin sold on purejeannius.com. It adds sections that are not part of this plugin: a countdown that can open the site by itself, social icons, a video, a contact or sign-up form, a map and custom HTML.

Developer hooks

Filters:

  • pjmaint_is_active( bool $active, array $settings )
  • pjmaint_bypass( bool $bypass, array $settings ) — let a visitor see the real site
  • pjmaint_rest_blocked_prefixes( string[] $prefixes ) — REST routes hidden from visitors while the page is up (default wp/v2, oembed/1.0 and WooCommerce’s public product routes)
  • pjmaint_rest_allowed_prefixes( string[] $prefixes ) — routes inside those that visitors may still use, e.g. wp/v2/categories
  • pjmaint_default_settings( array $defaults ), pjmaint_sanitize_settings( array $out, array $input )
  • pjmaint_sections( string[] $keys, array $settings ) — order of the page sections (logo, heading, content, links); add your own keys
  • pjmaint_content_allowed_html( array $tags ) — HTML allowed in the Content field (text formatting only by default)
  • pjmaint_css_vars( array $vars, array $settings )
  • pjmaint_retry_after( int $seconds, array $settings ) — the Retry-After header sent with the 503
  • pjmaint_toggle_on( array $stored, array $settings ) — settings saved when the admin-bar switch turns the page on
  • pjmaint_status_text( string $text, bool $on, array $settings ) — status line on the settings screen
  • pjmaint_settings_tabs( array $tabs )
  • pjmaint_export_html( string $html, array $settings, PJMaint_Export $export ) — change the exported index.html; $export->asset( $url ) adds a file from this site and returns its new path
  • pjmaint_export_file_types( string[] $extensions ) — file types copied into the export

Actions:

  • pjmaint_section_{$key}( array $settings ) — print a section
  • pjmaint_enqueue( array $settings ) — enqueue assets for the page (only these and PJ Maintenance’s own are printed; local files are copied into the static export too)
  • pjmaint_head, pjmaint_footer, pjmaint_before_render
  • pjmaint_settings_tab_{$key}( array $settings, string $option ), pjmaint_settings_after( array $settings ), pjmaint_register_settings, pjmaint_settings_page_load
  • pjmaint_purge_cache — clear your own cache or CDN

Installation

  1. Install and activate the plugin.
  2. Go to Settings → PJ Maintenance.
  3. Fill in the Content, Design and Buttons tabs, then click Preview page.
  4. On the General tab, tick Show the maintenance page to visitors and save.

FAQ

I turned it on but I still see my site

That’s expected: administrators (and the roles you choose) always see the real site. Use Preview page, or open the site in a private window.

Visitors still see the old site

A page cache or CDN is serving a saved copy. PJ Maintenance clears the common caching plugins when you save, but a CDN or firewall cache (such as Cloudflare or Sucuri) has to be cleared from its own dashboard.

A blog feed, gallery or slider is empty for me while the page is on

Some scripts load their posts from the REST API without sending your login, so WordPress can’t tell it’s you and PJ Maintenance hides the content as it would from any visitor. Either have the script send the login cookie (in fetch(), use credentials: 'same-origin' instead of 'omit'), or untick Hide content from the REST API on the General tab.

Which mode should I use?

Use Maintenance for a live site that is down for a few hours or days. Use Coming soon for a new site that hasn’t launched. Use Site closed / moved when the site is shutting down and you want to point people somewhere else.

The site is closing and everyone should go to one new site. Should I use Site closed?

A server-level 301 redirect of the whole domain to the new site is better in that case: it passes the old site’s search ranking on. Site closed is for pointing people to several places.

How do I keep the closed page up after deleting WordPress?

Click Download static page (.zip) on the General tab, back up the site, empty the site’s folder, and upload the zip’s contents (including .htaccess). README.txt inside the zip has the steps. The .htaccess needs Apache or LiteSpeed; the page itself works on any server.

Can I still log in?

Yes. The login page and the dashboard are never blocked. A small padlock in the corner of the page slides in a login panel (you can turn it off on the General tab). If a security plugin adds a CAPTCHA or a second step to your login, a sign-in from the panel continues on the regular login screen.

What happens to my settings if I delete the plugin?

They are removed.

Screenshots

Changelog

1.0.0

  • First release.