Skip to content

404 page with search in WordPress

A clean not-found page with a large error code, a search field and links to the main sections.

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

erreur-404-recherche.php
<?php
/**
 * Plugin Name: Forge, Page 404 avec recherche
 * Description: Une page introuvable sobre avec un grand code d'erreur, un champ de recherche et des liens vers les rubriques principales. Ajoute la composition « Page 404 avec recherche » à 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-erreur-404-recherche
 *
pattern.html
<!-- wp:group {"className": "nf", "layout": {"type": "default"}} -->
<div class="wp-block-group nf"><!-- wp:html -->
<p class="nf__code" aria-hidden="true">404</p>
<!-- /wp:html -->
<!-- wp:heading {"level": 1} -->
<h1 class="wp-block-heading">Cette page n'existe pas ou a été déplacée</h1>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Vérifiez l'adresse ou recherchez ce que vous cherchiez.</p>
<!-- /wp:paragraph -->
<!-- wp:html -->
<form class="nf__search" role="search" action="#recherche">
style.css
:root {
  --nf-text: #0b1b3a;
  --nf-muted: #46577a;
  --nf-code: #6f86bd;
  --nf-field: #ffffff;
  --nf-line: #9fb3dc;
  --nf-btn: #1d4ed8;
  --nf-btn-text: #ffffff;
  --nf-link: #1d4ed8;
  --nf-ring: #1d4ed8;
  --demo-erreur-404-recherche-bg: #f8faff;
  --demo-erreur-404-recherche-text: #0b1b3a;

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

Error pages components in WordPress
  • A ready-to-publish changelog page: dated, versioned notes grouped by month, each with a type badge (new, improvement, fix), module tags and filters that announce how many notes are shown.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Ready-to-fill terms of sale for a showcase site selling to consumers: seller, ordering, prices, delivery, withdrawal with a copyable form, statutory warranties and mediation, with 26 highlighted fields to complete and a side table of contents that follows the reader.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A ready-to-fill GDPR privacy policy for a showcase site: controller, data collected, purposes, retention periods, recipients, rights and cookies, with 24 highlighted fields to complete and a side table of contents that follows the reader.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A ready-to-fill French legal notice page: publisher, host, SIRET, contact, intellectual property and personal data, with 16 highlighted fields to complete and a side table of contents that follows the reader.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • The page shown after a quote request or contact message: clear confirmation, announced response time, printable summary, next steps and useful links.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A page shown during maintenance, with the expected return time and ways to stay informed.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component