Smart Custom 404 Error Page

Beschreibung

Bringing visitors to your website takes time and effort. Every visitor is important. The default 404 error page of most themes does not provide any information on what to find on your site. A first-time visitor, who does not know you, is left in a dead end and leaves your website. Set up a helpful custom 404 error page to keep them on your site!

Mit diesem praktischen Plugin kannst Du ohne Aufwand Deine eigene 404-Fehlerseite erstellen, die mit fast jedem Theme funktioniert.

Out of Retirement!

NerdPress has adopted Smart Custom 404 Page! Read the announcement here.

We’ve been fans of this plugin for many years, and we’re grateful for Peter’s many years of service to the community. Peter retired from plugin development in October 2023, so we’ve jumped in to help ensure this plugin continues to work well now and in the future.

Verwendung

Create your custom 404 error page just like any other page using the WordPress Editor (Pages > Add New). Then go to Appearance > 404 Error Page and select the created page as your custom 404 error page. That’s it!

Warum solltest Du dieses Plugin benutzen?

Unlike similar plugins the 404page plugin does not create redirects. That’s quite important because a correct code 404 is delivered which tells search engines that the page does not exist and has to be removed from the index.

Additionally, the 404page plugin does not create additional server requests.

Voraussetzungen

The only requirement for this plugin is that you change the Permalink Structure in Settings > Permalinks to anything else but „Plain.“ This also activates the WordPress 404 error handling.

Block & Shortcode

Block

Das Plugin bietet einen Block „404 Fehler URL“ für den Block Editor, um die URL anzuzeigen, die den Fehler verursacht hat. Es gibt drei mögliche Optionen:

  • „Page“ to show the page including path ( e.g. does/not/exist )
  • „Domain Path“ to show the URL without protocol and parameters ( e.g. example.com/does/not/exist )
  • „Full“ to show the complete URL ( e.g. https://example.com/does/not/exist?p=1 )

Shortcode

Das Plugin bietet einen Shortcode „pp_404_url“ für den Classic Editor, um die URL anzuzeigen, die den Fehler verursacht hat. Es gibt drei mögliche Optionen:

  • [pp_404_url page] to show the page including path ( e.g. does/not/exist )
  • [pp_404_url domainpath] to show the URL without protocol and parameters ( e.g. example.com/does/not/exist )
  • [pp_404_url] or [pp_404_url full] to show the complete URL ( e.g. https://example.com/does/not/exist?p=1 )

Plugin Datenschutzinformationen

  • Dieses Plugin setzt keine Cookies
  • Dieses Plugin sammelt und speichert keine Daten
  • Dieses Plugin sendet keine Daten an externe Server

Für Entwickler

Action-Hook

The plugin adds an action hook 404page_after_404 which you can use to add extra functionality. The exact position the action occurs after an 404 error is detected depends on the Operating Method. Your function must not generate any output. There are no parameters.

Konstante

If the 404page plugin is installed and activated it defines the PHP constant PP_404. Check existence of it to detect the 404page plugin.

Funktionen

Das Plugin stellt folgende Funktionen zur Verfügung:

  • pp_404_is_active() to check if there is a custom 404 page selected and the selected page exists
  • pp_404_get_page_id() to get the ID of the 404 page
  • pp_404_get_all_page_ids() to get an array of page IDs in all languages