Skip to content

Scheduled maintenance notice in WordPress

A notice warning of a scheduled service interruption, with date, time and impact.

Here is an excerpt of this component's code in WordPress. The full code is free for members, ready to copy into your project.

This component also comes in

Open in a new tab

The code in WordPress

alerte-maintenance.php
<?php
/**
 * Plugin Name: Forge, Avis de maintenance planifiée
 * Description: Un encart qui prévient d'une interruption de service programmée, avec la date, l'heure et l'impact. Ajoute la composition « Avis de maintenance planifiée » à l'éditeur de blocs.
 * Version: 1.0.0
 * Requires at least: 6.6
 * Requires PHP: 8.1
 * Author: Forge
 * License: GPL-2.0-or-later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: forge-alerte-maintenance
 *
pattern.html
<!-- wp:group {"tagName": "aside", "className": "maint", "layout": {"type": "default"}} -->
<aside class="wp-block-group maint"><!-- wp:html -->
<svg aria-hidden="true" viewBox="0 0 24 24" width="26" height="26" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3.5 2.5 20h19L12 3.5Z"/><path d="M12 10v4M12 17h.01"/></svg>
<!-- /wp:html -->
<!-- wp:group {"layout": {"type": "default"}} -->
<div class="wp-block-group"><!-- wp:heading {"level": 2, "anchor": "maint-title"} -->
<h2 class="wp-block-heading" id="maint-title">Maintenance prévue dans la nuit du 18 au 19 octobre</h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>L'application sera indisponible de <time datetime="2026-10-18T23:00+02:00">23 h</time> à <time datetime="2026-10-19T01:00+02:00">1 h</time>. Les paiements en ligne de vos clients restent possibles pendant l'intervention.</p>
<!-- /wp:paragraph -->
<!-- wp:html -->
style.css
:root {
  --mt-alerte-maintenance-bg: #fef9c3;
  --mt-alerte-maintenance-line: #eab308;
  --mt-alerte-maintenance-text: #2b2105;
  --mt-alerte-maintenance-icon: #854d0e;
  --mt-alerte-maintenance-ring: #2b2105;
  --demo-alerte-maintenance-bg: #fffef5;
  --demo-alerte-maintenance-text: #2b2105;
}

@media (prefers-color-scheme: dark) {
  :root.forge-follows-system:not([data-theme="light"]) {

Free component: copy it freely, including for commercial projects.

Toasts and alerts components in WordPress
  • A banner that warns visitors when they lose the network and announces when it is back, using browser events, with no request.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A bell with an unread badge that opens a notification panel: icons by type, read and unread items told apart, and a "Mark all as read" button.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • The four classic interface messages: information, success, warning and error.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Three callouts for technical documentation: note, tip and warning.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A dashed callout highlighting an offer and its code, with the end date.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • An announcement bar at the top of the page with a link and a button to close it.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component